Skip to content

Commit

Permalink
Merge pull request #117 from Fingel/master
Browse files Browse the repository at this point in the history
filter_overrides has been moved to the meta class in django-filter 0.15
  • Loading branch information
nemesifier committed Sep 26, 2016
2 parents 7ec925a + 5b5bc44 commit 7091af2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rest_framework_gis/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ class GeoFilterSet(django_filters.FilterSet):
}

def __new__(cls, *args, **kwargs):
cls.filter_overrides.update(cls.GEOFILTER_FOR_DBFIELD_DEFAULTS)
try:
cls._meta.filter_overrides.update(cls.GEOFILTER_FOR_DBFIELD_DEFAULTS)
except AttributeError: # Compatibility for django-filter < 0.15
cls.filter_overrides.update(cls.GEOFILTER_FOR_DBFIELD_DEFAULTS)
cls.LOOKUP_TYPES = sorted(gis_lookups)
return super(GeoFilterSet, cls).__new__(cls)

Expand Down

0 comments on commit 7091af2

Please sign in to comment.