selectors.py 298 B

1234567891011121314
  1. from account.models import User
  2. import django_filters
  3. class UserFilter(django_filters.FilterSet):
  4. email = django_filters.CharFilter(lookup_expr="icontains")
  5. def get_users(filters=None):
  6. filters = filters or {}
  7. qs = User.objects.all()
  8. return UserFilter(filters, queryset=qs).qs