We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e14cb7 commit bf44f6dCopy full SHA for bf44f6d
sensorsafrica/api/v2/filters.py
@@ -1,6 +1,15 @@
1
+from django.db import models
2
+import django_filters
3
from feinstaub.sensors.views import SensorFilter
4
5
class CustomSensorFilter(SensorFilter):
6
class Meta(SensorFilter.Meta):
- # Pick the fields already defined and add the location__country field
- fields = {**SensorFilter.Meta.fields, **{'location__country': ['exact']}}
7
+ fields = {"sensor": ["exact"],
8
+ "location__country": ['exact'],
9
+ "timestamp": ("gte", "lte"),
10
+ }
11
+ filter_overrides = {
12
+ models.DateTimeField: {
13
+ 'filter_class': django_filters.IsoDateTimeFilter,
14
+ },
15
0 commit comments