forked from rc/aircox
fix date lookup filters
This commit is contained in:
@ -17,8 +17,10 @@ class DateFieldFilter(filters.FieldListFilter):
|
||||
self.date_params = {k: v for k, v in params.items()
|
||||
if k.startswith(self.field_generic)}
|
||||
|
||||
exact_lookup = 'date' if isinstance(field, models.DateTimeField) else 'exact'
|
||||
|
||||
# links as: (label, param, input_type|None, value)
|
||||
self.links = [(_('Exact'), self.field_generic + 'exact', self.input_type),
|
||||
self.links = [(_('Exact'), self.field_generic + exact_lookup, self.input_type),
|
||||
(_('Since'), self.field_generic + 'gte', self.input_type),
|
||||
(_('Until'), self.field_generic + 'lte', self.input_type)]
|
||||
if field.null:
|
||||
|
Reference in New Issue
Block a user