Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- serializer_class = QuestionSerializer # set the serializer
- queryset = Question.objects.all() # set the query set to all the objects of that view
- filter_backends = (DjangoFilterBackend, OrderingFilter, SearchFilter) # allows for filters
- filter_fields = {'id': ['gte', 'lte', 'exact'], 'pub_date': ['gte', 'lte']}
- ordering_fields = ('id', 'question_text', 'pub_date')
- search_fields = 'question_text'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement