diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-06-02 20:41:58 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-06-02 20:41:58 +0200 |
| commit | 7eab18f839616140fe3dbc4b51e29ec903c48077 (patch) | |
| tree | c6f4160b7567904726f8036d2f5a2ef4d7846093 /cli | |
| parent | 402dd17858076b6a0fac618de85614114dfe94fe (diff) | |
adding les pages
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/app/controllers/page_controller.py | 7 | ||||
| -rw-r--r-- | cli/app/controllers/tile_controller.py | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/cli/app/controllers/page_controller.py b/cli/app/controllers/page_controller.py index 1f53171..41d30f3 100644 --- a/cli/app/controllers/page_controller.py +++ b/cli/app/controllers/page_controller.py @@ -17,5 +17,12 @@ class PageView(CrudView): query = query.filter(Page.graph_id == int(graph_id)) return query + def on_create(self, session, form, item): + item.settings = form['settings'] + item.graph_id = int(form['graph_id']) + + def on_update(self, session, form, item): + item.settings = form['settings'] + def on_destroy(self, session, item): session.query(Tile).filter(Tile.page_id == item.id).delete(synchronize_session=False) diff --git a/cli/app/controllers/tile_controller.py b/cli/app/controllers/tile_controller.py index 58fd6d0..6e68cb9 100644 --- a/cli/app/controllers/tile_controller.py +++ b/cli/app/controllers/tile_controller.py @@ -18,3 +18,9 @@ class TileView(CrudView): if page_id is not None: query = query.filter(Tile.page_id == int(page_id)) return query + + def on_create(self, session, form, item): + item.settings = form['settings'] + + def on_update(self, session, form, item): + item.settings = form['settings'] |
