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/page_controller.py | |
| parent | 1a7370c19a7eed6a5f0f48e270092f9b3caebbc1 (diff) | |
forms
Diffstat (limited to 'cli/app/controllers/page_controller.py')
| -rw-r--r-- | cli/app/controllers/page_controller.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/app/controllers/page_controller.py b/cli/app/controllers/page_controller.py index 5263cf0..d393625 100644 --- a/cli/app/controllers/page_controller.py +++ b/cli/app/controllers/page_controller.py @@ -11,5 +11,11 @@ class PageView(CrudView): model = Page form = PageForm + def where(self, query, args): + graph_id = args.get('graph_id', default=None) + if graph_id is not None: + query = query.where(Page.graph_id == int(graph_id)) + return query + def on_destroy(self, session, item): session.query(Tile).filter(Tile.page_id == item.id).delete(synchronize_session=False) |
