some changes to virtual command

This commit is contained in:
Tobias Kurze
2019-08-05 15:28:39 +02:00
parent 186614bc4a
commit 123eb65f8e

View File

@@ -77,17 +77,17 @@ class VirtualCommand(db.Model):
def command_order(self):
if self.command_order_string is None:
return []
return self.command_order_string.split()
return json.loads(self.command_order_string)
@command_order.setter
def command_order(self, value: list):
pass
def command_order(self, ordered_list_of_commands: list):
self.command_order_string = json.dumps(ordered_list_of_commands)
def __str__(self):
return self.name
def to_dict(self):
return dict(id=self.id, name=self.name)
return dict(id=self.id, name=self.name, description=self.description)
def toJSON(self):
return json.dumps(self.to_dict(), default=lambda o: o.__dict__,