Browse Source

Feature: Add search function to boards

pull/179/head
winkidney 4 years ago
parent
commit
b7734ec232
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      core/views.py

+ 2
- 1
core/views.py View File

@@ -36,7 +36,8 @@ class PinViewSet(viewsets.ModelViewSet):


class BoardViewSet(viewsets.ModelViewSet): class BoardViewSet(viewsets.ModelViewSet):
serializer_class = api.BoardSerializer serializer_class = api.BoardSerializer
filter_backends = (DjangoFilterBackend, OrderingFilter)
filter_backends = (DjangoFilterBackend, OrderingFilter, SearchFilter)
search_fields = ("name", )
filter_fields = ("submitter__username", ) filter_fields = ("submitter__username", )
ordering_fields = ('-id', ) ordering_fields = ('-id', )
ordering = ('-id', ) ordering = ('-id', )


Loading…
Cancel
Save