summaryrefslogtreecommitdiff
path: root/cli/app/controllers/crud_controller.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/app/controllers/crud_controller.py')
-rw-r--r--cli/app/controllers/crud_controller.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/cli/app/controllers/crud_controller.py b/cli/app/controllers/crud_controller.py
index 28b2a25..7692d26 100644
--- a/cli/app/controllers/crud_controller.py
+++ b/cli/app/controllers/crud_controller.py
@@ -13,6 +13,8 @@ class CrudView(FlaskView):
excluded_methods = ['on_index', 'on_show', 'on_create', 'on_update', 'on_destroy']
# implement these methods:
+ def where(self, query, args):
+ return query
def on_index(self, session, data):
return data
def on_show(self, session, data):
@@ -35,6 +37,7 @@ class CrudView(FlaskView):
offset, limit = parse_search_args(request.args)
sort, order, order_by, order_by_id = parse_sort_args(request.args, self.model)
query = session.query(self.model)
+ query = self.where(query, request.args)
if order_by_id is not None:
query = query.order_by(order_by, order_by_id)
else: