From 00720e1e73b6ee9c3ef0efae733eacbd9508c08d Mon Sep 17 00:00:00 2001 From: "Tomas \"Jethro\" Pokorny" Date: Tue, 17 Nov 2020 20:18:40 +0100 Subject: [PATCH] TreeNode editor | Priprava na vybirani vzoraku. --- seminar/viewsets.py | 11 +++++++++++ vue_frontend/src/components/UlohaVzorakNode.vue | 11 ++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/seminar/viewsets.py b/seminar/viewsets.py index 67b13b3d..9d600375 100644 --- a/seminar/viewsets.py +++ b/seminar/viewsets.py @@ -93,4 +93,15 @@ class ProblemViewSet(viewsets.ModelViewSet): def get_queryset(self): queryset = m.Problem.objects.all() + ucel = self.request.query_params.get('ucel',None) + rocnik = self.request.query_params.get('rocnik',None) + tema = self.request.query_params.get('tema',None) + + if rocnik is not None: + queryset = queryset.filter(rocnik=rocnik) + + #if tema is not None: + + + return queryset diff --git a/vue_frontend/src/components/UlohaVzorakNode.vue b/vue_frontend/src/components/UlohaVzorakNode.vue index 753a5cef..35804198 100644 --- a/vue_frontend/src/components/UlohaVzorakNode.vue +++ b/vue_frontend/src/components/UlohaVzorakNode.vue @@ -1,7 +1,8 @@