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
django-tagging integration #17
Comments
The right solution is to make a "TagFilter", I might write up a prototype if I have the time, but basically look at some of the Filters inlcuded in django-filter now for an example of what it might look like. |
cool, thanks. so far, i copied the AllValuesFilter and extended the MultipleChoiceFilter:
this displays properly, but will i have to modify BaseFilterSet to deal with tag matching? |
Now you need to override the filter() method on TagFilter, to do the actual filtering. If you look at the parameters it gets it should be obvious what you need to do :) |
thanks for your help, alex!
unfortunately, it doesn't play nice with the other fields in the FilterSet (which are ignored); i'm assuming because there is no |
Yeah, filter should return a QuerySet that is just the one passed to it filtered down. Perhaps the best bet is to make the tag filter the first filter on your FilterSet. |
ah, i missed this bit in the django-tagging docs:
http://code.google.com/p/django-tagging/source/browse/trunk/docs/overview.txt changing the relevant line in TagFilter to the following seems to work:
cool. thanks for your help! |
I'm not sure it's a good thing to include this tag application since it hasn't been updated for the last 2 years. |
I'm going to close this one for now. If someone wants to put together a pull request with a (I'm slightly cautious about adding integrations with every-and-other Django apps out there — it seems like a never ending task — but certainly some cases may be justified and having examples to guide implementations would be good.) |
hi alex, great project!
i've been trying various things for a while, but i can't seem to find a decent solution to filter tags from django-tagging with django-filter.
have you considered this? could you point me in the right direction, code-wise?
The text was updated successfully, but these errors were encountered: