Closed N3TC4T closed 8 years ago
By "user side" I assume you mean outside of the Django Admin? Regrettably, we have not written django-advanced-filters
with the intent of being a generic query building tool.
However, the basic idea can survive outside of the admin: the forms.py
contains a (mostly) generic pair of forms/form-sets that can be used to create a "user-friendly" interface for simple query construction (notice that it currently expects either to be given model_admin
or model instance
on initialization, to determine the model).
Additionally, the AdvancedFilter
model itself has only one job: it serializes and stores the query in a database record, so you could as easily use it for anything else.
So all that is left for you, is the following:
AdvancedFilter
.AdvancedFilter
and calling instance.query
to receive back a Q() object to be used to filter the target model.If you have any other questions, hit me up on gitter.
Hey bro
how can I use this cool module in my user side ?