Skip to content

Commit

Permalink
add modified and created fields in filter API
Browse files Browse the repository at this point in the history
  • Loading branch information
erivanio committed Jul 9, 2018
1 parent 9c99472 commit 6bebe09
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions wikilegis/api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
}


Expand All @@ -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'],
}


Expand All @@ -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'],
}


Expand All @@ -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'],
}


Expand All @@ -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'],
}

0 comments on commit 6bebe09

Please sign in to comment.