Newer
Older
from cubes.compound.entities import IClonable, IContained, IContainer, structure_def
def agent_structure_def(schema):
return structure_def(schema, 'Agent').items()
class AgentIClonable(IClonable):
rtype = 'clone_of'
def registration_callback(vreg):
vreg.register_all(globals().values(), __name__)
# clear IContained._classes dict is necessary during tests where modules are not reloaded
IContained._classes.clear()
vreg.register(IContainer.build_class('Agent'))
for etype, parent_relations in agent_structure_def(vreg.schema):
IContained.register_class(vreg, etype, parent_relations)