Django Q Filter
Project description
Django Q Filter
complex filtering based on Django Q
Overview
Use the power of Django Q Objects to filter django models with complex queries. Django Q Filter provides filter forms (based on bootstrap and jQuery) and utils for complex query filters.
The filter form selects the possible django model fields dynamically and computes a Q-Query with the given input.
the resulting queryset is automatically annotated with the field and values of the given Q-Query. results of a Q-Query are always a "joined" style list and to enhance the experience, a normalized result set can be computed, where the values can be merged.
For demo purposes, an example project is provided.
Requirements
- Python (3.6, 3.7, 3.8, 3.9)
- Django (2.2, 3.0, 3.1)
- django-crispy-forms
Installation
Install using pip
...
pip install django-q-filter
Add 'qfilter'
to your INSTALLED_APPS
setting.
INSTALLED_APPS = [
...
'qfilter',
]
Use Q-Filter mixin in django views. See example project.
# example/food/views.py
class RecipeListView(QQueryViewMixin, ListView):
"""
Recipe List View
"""
model = Recipe
template_name = 'food/recipe_list.html'
ordering = ['name']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for django_q_filter-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa316071fa633e4afa234393d0cf6865cfd55b8e5997389412bf5d60666d7c92 |
|
MD5 | 22899cb35524ada45d4e77021a5bb7a8 |
|
BLAKE2b-256 | e44d4478a2d4b2e3f7806df7b665f986970b2aff8722b58f2bb7a4d7e19b27a1 |