dsmultimedika commited on
Commit
015e632
·
1 Parent(s): 1c14126

fix: improve base query

Browse files
Files changed (1) hide show
  1. db/query/base_query.py +2 -1
db/query/base_query.py CHANGED
@@ -52,8 +52,9 @@ class BaseQuery:
52
  def delete(self, db, model, id=None, filter_conditions=None):
53
  """Delete an entry by ID with optional filter conditions."""
54
  # Build the query to select the entry
 
55
  if id :
56
- query = select(model).where(model.id == id)
57
 
58
  if filter_conditions:
59
  query = query.where(*filter_conditions)
 
52
  def delete(self, db, model, id=None, filter_conditions=None):
53
  """Delete an entry by ID with optional filter conditions."""
54
  # Build the query to select the entry
55
+ query = select(model)
56
  if id :
57
+ query = query.where(model.id == id)
58
 
59
  if filter_conditions:
60
  query = query.where(*filter_conditions)