We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I tried to use DistanceToPointFilter to filter through distance, I got the issue that there is a KeyError about dwithin.
DistanceToPointFilter
dwithin
class Location(models.Model): user = models.ForeignKey('UserProfile', null=True, blank=True, on_delete=models.CASCADE) address = models.CharField(max_length=255) number = models.CharField(max_length=255) city = models.CharField(max_length=100) state = models.CharField(max_length=100) zipcode = models.CharField(max_length=5) # point = gis_models.PointField() geometry = gis_models.GeometryField() class Meta: verbose_name = 'Location' verbose_name_plural = 'Locations' def __str__(self): return self.geometry
class LocationSerializer(GeoFeatureModelSerializer): class Meta: model = Location geo_field = 'geometry' fields = "__all__"
class LocationListViewSet(viewsets.GenericViewSet, mixins.ListModelMixin): queryset = Location.objects.all() serializer_class = LocationSerializer distance_filter_convert_meters = True distance_filter_field = 'geometry' filter_backends = (DistanceToPointFilter,)
The text was updated successfully, but these errors were encountered:
Hi! I'd be happy to take up this
Sorry, something went wrong.
No branches or pull requests
When I tried to use
DistanceToPointFilter
to filter through distance, I got the issue that there is a KeyError aboutdwithin
.models.py
serializers.py
views.py
The text was updated successfully, but these errors were encountered: