Skip to content

Commit

Permalink
1.5.3 - fix cascade deletes for SQLAlchemy, more tests, logging
Browse files Browse the repository at this point in the history
  • Loading branch information
valhuber committed Mar 16, 2022
1 parent 3bd4242 commit cee2dd1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/nw/logic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
if by_rules:
LogicBank.activate(session=session, activator=declare_logic)
else:
legacy_setup.setup(session) # ignore test asserts that fail due to (unimplemenmted) counts (else ok)
legacy_setup.setup(session) # ignore test asserts that fail due to (unimplemented) counts (else ok)

print("\n")
print("*********************")
Expand Down
2 changes: 1 addition & 1 deletion examples/nw/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def copy_gold_over_db():


def setUp(file: str):
""" copy gold over db
""" copy gold over db, setup-complete banner
"""
copy_gold_over_db()

Expand Down
4 changes: 2 additions & 2 deletions logic_bank/exec_row_logic/logic_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ def delete(self, reason: str = None, row: base = None, do_not_adjust_list = None
user_logic_row.insert(reason=reason)
else:
self.reason = reason
self.log("delete - " + reason)
self.log("Delete - " + reason)
self.early_row_event_all_classes("Delete - " + reason)
self.early_row_events()
self.adjust_parent_aggregates(do_not_adjust_list=do_not_adjust_list)
Expand Down Expand Up @@ -937,7 +937,7 @@ def save_altered_parents(self, do_not_adjust_list: List = None):
else:
is_do_not_adjust = self.parent_logic_row.is_in_list(do_not_adjust_list)
if is_do_not_adjust:
self.child_logic_row.log_engine(f'do not adjust deleted parent row: {self.parent_role_name}')
self.child_logic_row.log(f'No adjustment on deleted parent: {self.parent_role_name}')
else:
parent_logic_row.ins_upd_dlt = "upd"
parent_logic_row.update(reason="Adjusting " + self.parent_role_name + ": " + self.adjusting_attributes)
Expand Down
2 changes: 1 addition & 1 deletion logic_bank/rule_type/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def adjust_from_deleted_child(self,
curr_value = getattr(parent_adjustor.parent_logic_row.row, self._column)
is_do_not_adjust = parent_adjustor.parent_logic_row.is_in_list(do_not_adjust_list)
if is_do_not_adjust:
# parent_adjustor.child_logic_row.log("do not adjust deleted rows")
parent_adjustor.child_logic_row.log_engine("do not adjust deleted rows")
pass
else:
setattr(parent_adjustor.parent_logic_row.row, self._column, curr_value - delta)
Expand Down

0 comments on commit cee2dd1

Please sign in to comment.