Commit 3eab2dea authored by Cédric Bonhomme's avatar Cédric Bonhomme

Fixed bug when calling .count on queryset object.

parent 939fac86
......@@ -26,11 +26,11 @@ class EPCISEventAPI(Resource):
result = models.EPCISEvent.objects[:10]
if result.count == 0:
if result.count() == 0:
return jsonify(result="no epcis event")
epcis_events = [ for epcis_event in result]
return jsonify(result="ok", epcis_events=epcis_events)
return jsonify(result="ok", nb_items=result.count(), epcis_events=epcis_events)
def put(self):
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment