Message ID | 20170207215355.2889-1-stephen@that.guru |
---|---|
State | Accepted |
Headers | show |
On 02/07/2017 03:53 PM, Stephen Finucane wrote: > It would appear that object-based mixins don't work with django-filter's > FilterSet. This should probably be fixed upstream, but for now let's > live with the extra duplication. > > Signed-off-by: Stephen Finucane <stephen@that.guru> > Fixes: 0fc32337 ("REST: Integrate django-filter support") > Cc: Andy Doan <andy.doan@linaro.org> Reviewed-by: Andy Doan <andy.doan@linaro.org>
diff --git a/patchwork/api/filters.py b/patchwork/api/filters.py index f475ca8..ecef304 100644 --- a/patchwork/api/filters.py +++ b/patchwork/api/filters.py @@ -26,7 +26,7 @@ from patchwork.models import Patch from patchwork.models import Series -class TimestampMixin(object): +class TimestampMixin(FilterSet): # TODO(stephenfin): These should filter on a 'updated_at' field instead before = IsoDateTimeFilter(name='date', lookup_expr='lt')
It would appear that object-based mixins don't work with django-filter's FilterSet. This should probably be fixed upstream, but for now let's live with the extra duplication. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 0fc32337 ("REST: Integrate django-filter support") Cc: Andy Doan <andy.doan@linaro.org> --- I've reported this upstream [1] but we want this to work now. [1] https://github.com/carltongibson/django-filter/issues/618 --- patchwork/api/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)