Commit adbea233 by Dudás Ádám

vm: suffix id to name when converting Instance to string

parent f3aa35f9
...@@ -330,7 +330,8 @@ class Instance(BaseResourceConfigModel, TimeStampedModel): ...@@ -330,7 +330,8 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
verbose_name_plural = _('instances') verbose_name_plural = _('instances')
def __unicode__(self): def __unicode__(self):
return self.name parts = [self.name, "(" + str(self.id) + ")"]
return " ".join([s for s in parts if s != ""])
@classmethod @classmethod
def create_from_template(cls, template, owner, **kwargs): def create_from_template(cls, template, owner, **kwargs):
...@@ -689,6 +690,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel): ...@@ -689,6 +690,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
queue="localhost.man") queue="localhost.man")
class InstanceActivity(ActivityModel): class InstanceActivity(ActivityModel):
instance = ForeignKey(Instance, related_name='activity_log', instance = ForeignKey(Instance, related_name='activity_log',
help_text=_('Instance this activity works on.'), help_text=_('Instance this activity works on.'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment