Skip to content

Commit

Permalink
Create DeleteQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Jul 29, 2019
1 parent 0c63010 commit af62c14
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ def execute_query(self):
self.commit_changes()


class DeleteQuery(Query):

def __init__(self, table, row):
super().__init__(table)
self.row = row

def execute_query(self):
log.info(f" Deleting row {self.row} from {self.table.__tablename__}")
self.session.delete(self.row)
self.commit_changes()


def insert_row_into_table(row):
"""
Insert the given row into its table
Expand Down

0 comments on commit af62c14

Please sign in to comment.