Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TestSerializer(DocumentSerializer):
- class Meta(object):
- document = TestDocument
- fields = ("id", "name")
- class TestDocumentViewSet(DocumentViewSet):
- document = TestDocument
- serializer_class = TestSerializer
- lookup_field = 'id'
- filter_backends = [
- CompoundSearchFilterBackend,
- ]
- multi_match_search_fields = ('id', 'name')
- filter_fields = {
- 'id': 'id',
- 'name': 'name',
- }
- ordering_fields = {
- 'id': 'id',
- 'name': 'name',
- }
- ordering = ('id', 'name')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement