Skip to content
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

Added method to delete specific table entry rather than table.delete() #29

Merged
merged 5 commits into from
Jan 13, 2023

Conversation

b-becker-k
Copy link
Collaborator

Changes the behaviour of the delete method when called from a specific table entry.
Currently running

p = mro.table.select_one("name='TestName'")
p.delete()

is equivalent to

p.table.delete()

This adds a delete method to database entry custom classes in the same way the update or create was done, which generates a clause based on the entry's primary keys to only delete this specific entry.
eg, if the table has primary keys id and name;

p = mro.table.select_one("name='TestName'")
p.delete()

is now equivalent to;

p = mro.table.select_one("name='TestName'")
mro.table.delete('id=%s and name=%s', 12, 'TestName')

@b-becker-k b-becker-k self-assigned this Jan 13, 2023
@b-becker-k b-becker-k removed the request for review from Dark-Bob January 13, 2023 11:46
@b-becker-k b-becker-k merged commit fdc749d into master Jan 13, 2023
@b-becker-k b-becker-k deleted the add_entry_delete branch January 13, 2023 16:09
Dark-Bob pushed a commit that referenced this pull request Mar 3, 2023
#29)

* Allow the use of table class update method
* Allow the use of table object delete method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants