aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/api
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r/views/api')
-rw-r--r--pyaggr3g470r/views/api/common.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pyaggr3g470r/views/api/common.py b/pyaggr3g470r/views/api/common.py
index 8083cb4c..ea5172c2 100644
--- a/pyaggr3g470r/views/api/common.py
+++ b/pyaggr3g470r/views/api/common.py
@@ -161,12 +161,19 @@ class PyAggResourceMulti(PyAggAbstractResource):
"""retrieve several objects. filters can be set in the payload on the
different fields of the object, and a limit can be set in there as well
"""
+ args = None
+ args = [item[0] for item in request.args.items()]
+ args = json.loads(args[0])
+
try:
limit = request.json.pop('limit', 10)
order_by = request.json.pop('order_by', None)
query = self.controller.read(**request.json)
except:
- limit, order_by, query = 10, None, self.controller.read()
+ if None is not args:
+ limit, order_by, query = 10, None, self.controller.read(**args)
+ else:
+ limit, order_by, query = 10, None, self.controller.read()
if order_by:
query = query.order_by(order_by)
if limit:
bgstack15