Skip to content

Instantly share code, notes, and snippets.

@craigderington craigderington/filters.py
Last active Apr 1, 2016

Embed
What would you like to do?
Django Filters - FilterSet
# filters.py
import django_filters
from .models import Customer
class CustomerListFilter(django_filters.FilterSet):
class Meta:
model = Customer
fields = ['account_number', 'customer_first_name', 'customer_last_name',
'primary_phone', 'city', 'state', 'customer_email']
order_by = ['pk']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.