|
|
|
@ -101,6 +101,8 @@ class Play(Base, Taggable, CollectionSearch):
|
|
|
|
|
self._action_groups = {}
|
|
|
|
|
self._group_actions = {}
|
|
|
|
|
|
|
|
|
|
self._collection = None
|
|
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
|
return self.get_name()
|
|
|
|
|
|
|
|
|
@ -150,8 +152,9 @@ class Play(Base, Taggable, CollectionSearch):
|
|
|
|
|
return self.name
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def load(data, variable_manager=None, loader=None, vars=None):
|
|
|
|
|
def load(data, variable_manager=None, loader=None, vars=None, collection=None):
|
|
|
|
|
p = Play()
|
|
|
|
|
p._collection = collection
|
|
|
|
|
if vars:
|
|
|
|
|
p.vars = vars.copy()
|
|
|
|
|
return p.load_data(data, variable_manager=variable_manager, loader=loader)
|
|
|
|
@ -383,19 +386,23 @@ class Play(Base, Taggable, CollectionSearch):
|
|
|
|
|
roles = []
|
|
|
|
|
for role in self.get_roles():
|
|
|
|
|
roles.append(role.serialize())
|
|
|
|
|
|
|
|
|
|
data['roles'] = roles
|
|
|
|
|
data['included_path'] = self._included_path
|
|
|
|
|
data['action_groups'] = self._action_groups
|
|
|
|
|
data['group_actions'] = self._group_actions
|
|
|
|
|
data['collection'] = self._collection
|
|
|
|
|
|
|
|
|
|
return data
|
|
|
|
|
|
|
|
|
|
def deserialize(self, data):
|
|
|
|
|
super(Play, self).deserialize(data)
|
|
|
|
|
|
|
|
|
|
self._collection = data.get('collection', None)
|
|
|
|
|
self._included_path = data.get('included_path', None)
|
|
|
|
|
self._action_groups = data.get('action_groups', {})
|
|
|
|
|
self._group_actions = data.get('group_actions', {})
|
|
|
|
|
|
|
|
|
|
if 'roles' in data:
|
|
|
|
|
role_data = data.get('roles', [])
|
|
|
|
|
roles = []
|
|
|
|
@ -414,4 +421,5 @@ class Play(Base, Taggable, CollectionSearch):
|
|
|
|
|
new_me._included_path = self._included_path
|
|
|
|
|
new_me._action_groups = self._action_groups
|
|
|
|
|
new_me._group_actions = self._group_actions
|
|
|
|
|
new_me._collection = self._collection
|
|
|
|
|
return new_me
|
|
|
|
|