Example #1
0
class ExplicitLookupsPersonDateFilter(FilterSet):
    date_joined = AllLookupsFilter(name='date_joined')
    time_joined = AllLookupsFilter(name='time_joined')
    datetime_joined = AllLookupsFilter(name='datetime_joined')

    class Meta:
        model = Person
Example #2
0
class AllLookupsPersonDateFilter(FilterSet):
    date_joined = AllLookupsFilter(field_name='date_joined')
    time_joined = AllLookupsFilter(field_name='time_joined')
    datetime_joined = AllLookupsFilter(field_name='datetime_joined')

    class Meta:
        model = Person
        fields = []
class BFilter(FilterSet):
    name = AllLookupsFilter(field_name='name')
    c = RelatedFilter('CFilter', field_name='c', queryset=C.objects.all())

    class Meta:
        model = B
        fields = []
Example #4
0
class UserFilterWithAll(FilterSet):
    username = AllLookupsFilter(field_name='username')
    email = filters.CharFilter(field_name='email')

    class Meta:
        model = User
        fields = []
Example #5
0
class PersonFilter(FilterSet):
    name = AllLookupsFilter(field_name='name')
    best_friend = RelatedFilter('tests.testapp.filters.PersonFilter', field_name='best_friend', queryset=Person.objects.all())

    class Meta:
        model = Person
        fields = []
Example #6
0
class PersonFilter(FilterSet):
    name = AllLookupsFilter(name='name')
    best_friend = RelatedFilter('tests.testapp.filters.PersonFilter',
                                name='best_friend')

    class Meta:
        model = Person
class BFilter(FilterSet):
    name = AllLookupsFilter(name='name')
    c = RelatedFilter(CFilter, name='c')

    class Meta:
        model = B
        fields = []
class BlogFilter(FilterSet):
    name = AllLookupsFilter(field_name='name')
    post = RelatedFilter('PostFilter',
                         field_name='post',
                         queryset=Post.objects.all())

    class Meta:
        model = Blog
        fields = []
class NoteFilter(FilterSet):
    title = AllLookupsFilter(field_name='title')
    author = RelatedFilter(UserFilter,
                           field_name='author',
                           queryset=User.objects.all())

    class Meta:
        model = Note
        fields = []
class UserFilter(FilterSet):
    username = AllLookupsFilter(field_name='username')
    email = filters.CharFilter(field_name='email')
    last_login = filters.AllLookupsFilter()
    is_active = filters.BooleanFilter(field_name='is_active')

    class Meta:
        model = User
        fields = []
class TagFilter(FilterSet):
    name = AllLookupsFilter(field_name='name')

    class Meta:
        model = Tag
        fields = []
Example #12
0
class InSetLookupPersonNameFilter(FilterSet):
    name = AllLookupsFilter('name')

    class Meta:
        model = Person
        fields = []
Example #13
0
class InSetLookupPersonIDFilter(FilterSet):
    pk = AllLookupsFilter('id')

    class Meta:
        model = Person
        fields = []
Example #14
0
class NoteFilterWithAll(FilterSet):
    title = AllLookupsFilter(field_name='title')

    class Meta:
        model = Note
        fields = []
Example #15
0
class TagFilter(FilterSet):
    name = AllLookupsFilter(name='name')

    class Meta:
        model = Tag