diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-06-01 18:34:00 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-06-01 18:34:00 +0200 |
| commit | 288694ae9a61c59dba91e2357fa7785d95a51341 (patch) | |
| tree | b20e1984ac881fa194fd26b19cfa8ee483ed000e /cli/app/controllers/crud_controller.py | |
| parent | 1a7370c19a7eed6a5f0f48e270092f9b3caebbc1 (diff) | |
forms
Diffstat (limited to 'cli/app/controllers/crud_controller.py')
| -rw-r--r-- | cli/app/controllers/crud_controller.py | 3 |
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: |
