carltongibson / django-filter

A generic system for filtering Django QuerySets based on user selections
https://django-filter.readthedocs.io/en/main/
Other
4.46k stars 769 forks source link

postgis #1169

Closed elcolie closed 3 years ago

elcolie commented 4 years ago

Do you have plan to support postgis? For example search that read the point and distance at the same time

carltongibson commented 4 years ago

Not really... what would it need? Custom Filter subclasses?

elcolie commented 4 years ago

Yes and it receive 2 inputs at the same time. I had read the doc. It does receive only 1 input at a time

Andrew-Chen-Wang commented 4 years ago

@carltongibson @elcolie Also looking into some GeoDjango functionality, specifically a PointField (or MultiPointField) with a circular radius around (each) point. It really helps when using with location based apps. I'd be willing to help, but Carlton knows much more about Django than me, so I'd like some assistance in knowing what to write before starting a draft PR.

Some pointers that we could do for the (Multi)PolygonField would be distance from, within, or on the edge. Not sure about the LineStringField.

I guess some issues with supporting GeoDjango is the extent of it all. I had a lot of confusion when programming my first geolocation-based app with Django, so clear communication would be necessary for Django-filters.

I guess another issue would be which database to allow in tests/settings.py for geolocation development. For most people, that'd be using PostGIS (we can add the geolocation database in runtests.py by adding an arg for database name). Setting up Travis won't be a problem (although, should we test on multiple Postgres and/or Postgis versions? Not entirely supportive of SQLite geolocation extension...).

Idk, thoughts? Like how would I/we go about this? I'd much rather have the geolocation functionality in the main repo rather than in a plug-in repo so that everything is simultaneously updated.

carltongibson commented 4 years ago

OK... SO...

A django-filter Filter is (at most):

So some examples. And then what of those are needed?

Andrew-Chen-Wang commented 4 years ago

Thanks for the reply! I think I was more focused on url encoded filtering and basically neglecting forms -- the ui -- altogether. Addressing points:

I'm not too well versed about the Django widgets, so I'm not too well aware about their methods of mapping out the multitude of field lookups for GeoDjango (within, covers, intersects, etc.).