Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
ARIA-132-Models-cascading-deletion-raises-constraint-errors
Additional fixes:
- The relationships are now defined on both sides. we no longer use backref, but back_populates.
  • Loading branch information
mxmrlv committed Mar 28, 2017
1 parent 07cbfcd commit 2de049729f5d0fff50297d25a88f5eecdcf266f9
Show file tree
Hide file tree
Showing 9 changed files with 1,299 additions and 672 deletions.
@@ -375,7 +375,7 @@ max-attributes=20
min-public-methods=0

# Maximum number of public methods for a class (see R0904).
max-public-methods=20
max-public-methods=50

# Maximum number of boolean expressions in a if statement
max-bool-expr=5
@@ -102,10 +102,18 @@ def validate_status(self, key, value):
status = Column(Enum(*STATES, name='execution_status'), default=PENDING)
workflow_name = Column(Text)

@declared_attr
def logs(cls):
return relationship.one_to_many(cls, 'log')

@declared_attr
def service(cls):
return relationship.many_to_one(cls, 'service')

@declared_attr
def tasks(cls):
return relationship.one_to_many(cls, 'task')

# region foreign keys

@declared_attr
@@ -185,6 +193,10 @@ class PluginBase(ModelMixin):

__tablename__ = 'plugin'

@declared_attr
def tasks(cls):
return relationship.one_to_many(cls, 'task')

archive_name = Column(Text, nullable=False, index=True)
distribution = Column(Text)
distribution_release = Column(Text)
@@ -238,6 +250,10 @@ class TaskBase(ModelMixin):

INFINITE_RETRIES = -1

@declared_attr
def logs(cls):
return relationship.one_to_many(cls, 'log')

@declared_attr
def node(cls):
return relationship.many_to_one(cls, 'node')

0 comments on commit 2de0497

Please sign in to comment.