Skip to content

Instantly share code, notes, and snippets.

@craigderington
Last active April 1, 2016 22:38
Show Gist options
  • Save craigderington/ec75d53dba1d70e4e83fe936077d5442 to your computer and use it in GitHub Desktop.
Save craigderington/ec75d53dba1d70e4e83fe936077d5442 to your computer and use it in GitHub Desktop.
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