added json fields to task obj

This commit is contained in:
İsmail Başaran 2016-04-05 15:23:20 +03:00
parent 75ce3d84fa
commit 61cac2b507

View file

@ -41,12 +41,25 @@ class Task(object):
def plugin(self): def plugin(self):
return Plugin(self.task['plugin']) return Plugin(self.task['plugin'])
@property
def cron_str(self):
return '1 * * * *' #TODO update when task cron field added.
def to_string(self): def to_string(self):
return str(self.task) return str(self.task)
def to_json(self): def to_json(self):
return json.load(self.task) return json.dumps(self.task)
def from_json(self,json_value):
self.task = json.load(json_value)
@property @property
def obj_name(self): def obj_name(self):
return "TASK" return "TASK"
def cols(self):
return ['id', 'create_date', 'modify_date', 'command_cls_id', 'parameter_map', 'deleted', 'plugin']
def values(self):
return [str(self.id), str(self.create_date), str(self.modify_date), str(self.command_cls_id), str(self.parameter_map), str(self.deleted), self.plugin.to_string()]