Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
ARIA-208 Fix models relationships
  • Loading branch information
Ran Ziv committed May 22, 2017
1 parent 78d6019 commit 5798bbfc7d1a95965a4c44d2ebad5dad245c824a
Showing 1 changed file with 23 additions and 26 deletions.
@@ -210,10 +210,6 @@ def artifact_types(cls):
def services(cls):
return relationship.one_to_many(cls, 'service', dict_key='name')

@declared_attr
def operation_templates(cls):
return relationship.one_to_many(cls, 'operation_template')

@declared_attr
def node_templates(cls):
return relationship.one_to_many(cls, 'node_template', dict_key='name')
@@ -483,6 +479,22 @@ def type_name(cls):
def nodes(cls):
return relationship.one_to_many(cls, 'node')

@declared_attr
def interface_templates(cls):
return relationship.one_to_many(cls, 'interface_template', dict_key='name')

@declared_attr
def artifact_templates(cls):
return relationship.one_to_many(cls, 'artifact_template', dict_key='name')

@declared_attr
def capability_templates(cls):
return relationship.one_to_many(cls, 'capability_template', dict_key='name')

@declared_attr
def requirement_templates(cls):
return relationship.one_to_many(cls, 'requirement_template', child_fk='node_template_fk')

# endregion

# region many_to_one relationships
@@ -507,22 +519,6 @@ def properties(cls):
def attributes(cls):
return relationship.many_to_many(cls, 'parameter', prefix='attributes', dict_key='name')

@declared_attr
def interface_templates(cls):
return relationship.one_to_many(cls, 'interface_template', dict_key='name')

@declared_attr
def artifact_templates(cls):
return relationship.one_to_many(cls, 'artifact_template', dict_key='name')

@declared_attr
def capability_templates(cls):
return relationship.one_to_many(cls, 'capability_template', dict_key='name')

@declared_attr
def requirement_templates(cls):
return relationship.one_to_many(cls, 'requirement_template', child_fk='node_template_fk')

# endregion

description = Column(Text)
@@ -1209,11 +1205,6 @@ def relationship_template(cls):
def relationships(cls):
return relationship.one_to_many(cls, 'relationship')

@declared_attr
def target_node_type(cls):
return relationship.many_to_one(
cls, 'type', fk='target_node_type_fk', back_populates=relationship.NO_BACK_POP)

# endregion

# region many_to_one relationships
@@ -1222,6 +1213,11 @@ def target_node_type(cls):
def node_template(cls):
return relationship.many_to_one(cls, 'node_template', fk='node_template_fk')

@declared_attr
def target_node_type(cls):
return relationship.many_to_one(
cls, 'type', fk='target_node_type_fk', back_populates=relationship.NO_BACK_POP)

# endregion

# region many_to_many relationships
@@ -1845,7 +1841,8 @@ def operations(cls):

@declared_attr
def service_template(cls):
return relationship.many_to_one(cls, 'service_template')
return relationship.many_to_one(cls, 'service_template',
back_populates='workflow_templates')

@declared_attr
def interface_template(cls):

0 comments on commit 5798bbf

Please sign in to comment.