Skip to content
New issue

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

How to pass mulltiple values for same column in get request? #10

Open
krishnakafle opened this issue Aug 2, 2020 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@krishnakafle
Copy link

krishnakafle commented Aug 2, 2020

i want to get the vector tiles for the query like,

api/v1/data/example.mvt?tile=1/0/0&my_column__in=foo,foo1,foo2

In my specific case scenario, I have a column name houseId. Now I would like to extract vector tile, where houseId can take multiple values as illustrated in following code.
/api/v1/data/house.mvt?tile={z}/{x}/{y}&houseId__in=547090906080,547090105191

Simply stating the condition, I would prefer to have an "In" operator which inquires with a list of values over the column in models as in Django ORM filter with code like:
House.objects.filter(houseId__in=[547090906080,547090105191])

Further elaboration can be found in:
https://stackoverflow.com/questions/63217920/how-to-pass-mulltiple-values-for-same-column-in-get-request-vector-tile-django

@trollefson
Copy link
Member

trollefson commented Aug 5, 2020

Hi @krishnakafle,

Thank you for showing interest in adding a new feature to the package. The package doesn't currently support an in operator for filtering. I think it would be possible to add the in functionality within the method here:

https://github.com/corteva/djangorestframework-mvt/blob/master/rest_framework_mvt/managers.py#L109

If you'd like to attempt to add the feature please open a pull request. I can see how an in operator would be useful and will make sure it gets prioritized for the next release.

@trollefson trollefson added the enhancement New feature or request label Aug 5, 2020
@krishnakafle
Copy link
Author

Hello @trollefson,

I solved the issue with a different approach by customizing raw SQL according to my specific requirements in managers.py file.
Though I will try to contribute by creating the pull request as per the feature I have pointed out as soon as I can.

@henhuy
Copy link

henhuy commented Nov 17, 2020

Maybe some integration of django-filter would be very cool!

sebastiendarocha added a commit to neogeo-technologies/djangorestframework-mvt that referenced this issue Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants