Skip to content

Commit

Permalink
remove rules for cascade update/delete, per ORM support
Browse files Browse the repository at this point in the history
  • Loading branch information
valhuber committed Dec 21, 2020
1 parent f099769 commit deb8d3d
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions logic_bank/logic_bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,29 +120,30 @@ def parent_check(validate: object,
"""
return ParentCheck(validate=validate, error_msg=error_msg, enable=enable)

''' disabled, per ORM support (retained in case of misunderstandings)
@staticmethod
def parent_cascade(validate: object,
error_msg: str = "(error_msg not provided)",
relationship: str = "*",
action: ParentCascadeAction = ParentCascadeAction.NULLIFY):
"""
Parent Cascade specifies processing for child rows on parent delete
Example
Rule.parent_cascade(validate=Order, relationship="OrderDetailList", action=ParentCascadeAction.DELETE)
If rule or action not specified, default is ParentCascadeAction.NULLIFY
Parent_cascade with ParentCascadeAction.NULLIFY can raise ConstraintException, e.g.:
try:
session.commit()
except ConstraintException as ce:
print("Constraint raised: " + str(ce))
"""
return ParentCascade(validate=validate, error_msg=error_msg, relationship=relationship, action=action)
'''
'''
disabled, per ORM support (retained in case of misunderstandings)
@staticmethod
def parent_cascade(validate: object,
error_msg: str = "(error_msg not provided)",
relationship: str = "*",
action: ParentCascadeAction = ParentCascadeAction.NULLIFY):
"""
Parent Cascade specifies processing for child rows on parent delete
Example
Rule.parent_cascade(validate=Order, relationship="OrderDetailList", action=ParentCascadeAction.DELETE)
If rule or action not specified, default is ParentCascadeAction.NULLIFY
Parent_cascade with ParentCascadeAction.NULLIFY can raise ConstraintException, e.g.:
try:
session.commit()
except ConstraintException as ce:
print("Constraint raised: " + str(ce))
"""
return ParentCascade(validate=validate, error_msg=error_msg, relationship=relationship, action=action)
'''

@staticmethod
def formula(derive: InstrumentedAttribute, calling: Callable = None,
Expand Down

0 comments on commit deb8d3d

Please sign in to comment.