From 6bebe0946c24cee9a061d997d989c48515be3550 Mon Sep 17 00:00:00 2001 From: erivanio Date: Mon, 9 Jul 2018 09:06:16 -0300 Subject: [PATCH] add modified and created fields in filter API --- wikilegis/api/resources.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/wikilegis/api/resources.py b/wikilegis/api/resources.py index 6447baab..90759362 100644 --- a/wikilegis/api/resources.py +++ b/wikilegis/api/resources.py @@ -138,11 +138,12 @@ class Meta: reference__bill__status='draft' ).exclude(reference__bill__is_visible=False) allowed_methods = ['get'] - excludes = ['modified'] filtering = { 'author': ALL_WITH_RELATIONS, 'reference': ALL_WITH_RELATIONS, 'id': ALL, + 'created': ['exact', 'lt', 'lte', 'gte', 'gt'], + 'modified': ['exact', 'lt', 'lte', 'gte', 'gt'], } @@ -159,11 +160,12 @@ class Meta: replaced__bill__status='draft' ).exclude(replaced__bill__is_visible=False) allowed_methods = ['get'] - excludes = ['modified'] filtering = { 'author': ALL_WITH_RELATIONS, 'replaced': ALL_WITH_RELATIONS, 'id': ALL, + 'created': ['exact', 'lt', 'lte', 'gte', 'gt'], + 'modified': ['exact', 'lt', 'lte', 'gte', 'gt'], } @@ -180,11 +182,12 @@ class Meta: supressed__bill__status='draft' ).exclude(supressed__bill__is_visible=False) allowed_methods = ['get'] - excludes = ['modified'] filtering = { 'author': ALL_WITH_RELATIONS, 'supressed': ALL_WITH_RELATIONS, 'id': ALL, + 'created': ['exact', 'lt', 'lte', 'gte', 'gt'], + 'modified': ['exact', 'lt', 'lte', 'gte', 'gt'], } @@ -209,6 +212,8 @@ class Meta: 'author': ALL_WITH_RELATIONS, 'vote': ALL, 'id': ALL, + 'created': ['exact', 'lt', 'lte', 'gte', 'gt'], + 'modified': ['exact', 'lt', 'lte', 'gte', 'gt'], } @@ -225,4 +230,6 @@ class Meta: filtering = { 'author': ALL_WITH_RELATIONS, 'id': ALL, + 'created': ['exact', 'lt', 'lte', 'gte', 'gt'], + 'modified': ['exact', 'lt', 'lte', 'gte', 'gt'], }