App for generating forms allowing users to build model queries
django-modelqueryform is a flexible app that helps you build Q object generating forms.
It is a great tool if you want you users to be able to do filtered searches against your models.
The project can be found at https://github.com/ckirby/django-modelqueryform
The full documentation is at https://django-modelqueryform.readthedocs.org.
Useable default FormFields for ModelFields that:
.choicesdefined or are inherently made of choices (ie.
- Are represented as numeric types (eg.
- Text backed fields need code written to handle them. That is easy though, because:
Creation of FormFields, Q objects, and User readable query terms are completely customizable. You can target ModelFields:
- By name (If the field has specific requirements)
- By field type (Use the same widget or Q object builder for all
Can follow Model relationships or treat relationship fields as
Provides a new Field and Widget (
RangeWidget). These allow users to generate a
__lte pair for the orm, optionally also including an
- Dynamically generates min and max boundaries. (Aggregate
Maxon the model field)
null=Trueon the ModelField allows user to indicate if they want to include null values in the query
- Returns a
NumberInputwidgets (with min and max attributes)