Commit ad66da57 by Guba Sándor Committed by Őry Máté

vm: fixed node activity unicode and readable

parent e7769c2f
...@@ -98,6 +98,18 @@ class NodeActivity(ActivityModel): ...@@ -98,6 +98,18 @@ class NodeActivity(ActivityModel):
app_label = 'vm' app_label = 'vm'
db_table = 'vm_nodeactivity' db_table = 'vm_nodeactivity'
def __unicode__(self):
if self.parent:
return '{}({})->{}'.format(self.parent.activity_code,
self.node,
self.activity_code)
else:
return '{}({})'.format(self.activity_code,
self.node)
def get_readable_name(self):
return self.activity_code.split('.')[-1].replace('_', ' ').capitalize()
@classmethod @classmethod
def create(cls, code_suffix, node, task_uuid=None, user=None): def create(cls, code_suffix, node, task_uuid=None, user=None):
act = cls(activity_code='vm.Node.' + code_suffix, act = cls(activity_code='vm.Node.' + code_suffix,
......
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