From 288694ae9a61c59dba91e2357fa7785d95a51341 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 1 Jun 2020 18:34:00 +0200 Subject: forms --- cli/app/controllers/tile_controller.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cli/app/controllers/tile_controller.py') diff --git a/cli/app/controllers/tile_controller.py b/cli/app/controllers/tile_controller.py index c47237b..fc36943 100644 --- a/cli/app/controllers/tile_controller.py +++ b/cli/app/controllers/tile_controller.py @@ -9,3 +9,12 @@ from app.controllers.crud_controller import CrudView class TileView(CrudView): model = Tile form = TileForm + + def where(self, query, args): + graph_id = args.get('graph_id', default=None) + if graph_id is not None: + query = query.where(Tile.graph_id == int(graph_id)) + page_id = args.get('page_id', default=None) + if page_id is not None: + query = query.where(Tile.page_id == int(page_id)) + return query -- cgit v1.2.3-70-g09d2