Skip to content

Mini fix #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pysimplesql/pysimplesql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ def save_record(self, display_message=True, update_elements=True) -> None:

changed = {k:v for k,v in current_row.items()}

if not self.records_changed():
if not self.records_changed(recursive=False):
if display_message: sg.popup_quick_message('There were no changes to save!', keep_on_top=True)
return SAVE_NONE + SHOW_MESSAGE

Expand Down Expand Up @@ -2873,7 +2873,7 @@ def delete_record(self, q_obj:Query, cascade=True): # TODO: get ON DELETE CASCAD
for r in q_obj.frm.relationships:
if r.parent_table == q_obj.table:
child = self.quote_table(r.child_table)
fk_column = self.quote_column(q_obj.fk)
fk_column = self.quote_column(r.fk_column)
q = f'DELETE FROM {child} WHERE {fk_column}={q_obj.get_current(q_obj.pk_column)}'
self.execute(q)
logger.debug(f'Delete query executed: {q}')
Expand Down