Closed mlissner closed 8 years ago
Following up to this, I'm trying this for a separate model and realizing that it doesn't work because of circular import errors between to filters.py
files that I've created (one for each model).
Seems like a big gap, so I'm hopeful that there's a way to make this work.
Did you see the information at the end of the readme on recursive filters? E.g. filters.RelatedFilter('people.views.PersonFilter', name='best_friend')
If this stopped working then it may be a regression.
On Dec 21, 2015, at 3:01 PM, Mike Lissner notifications@github.com wrote:
Following up to this, I'm trying this for a separate model and realizing that it doesn't work because of circular import errors between to filters.py files that I've created (one for each model).
Seems like a big gap, so I'm hopeful that there's a way to make this work.
— Reply to this email directly or view it on GitHub.
I feel like an idiot. I looked everywhere for this answer. Except the readme, dang it. Anyway, PR sent to tweak the readme. I figure if I screwed this up, other people will too.
I have a database of judges each of whom have degrees from specific schools.
I want to use my API to either query judges that went to a specific school:
Or I want to filter which judges went to a specific school:
I can set up a
RelatedFilter
on one of these, but when I set it up on the second one, it can't find the class.This problem is handled in Django models by allowing strings for ForeignKey names:
Is there a way to do this with Django filters?
Thanks for the great package.