瀏覽代碼

Feature: Add search function to boards

pull/179/head
winkidney 4 年之前
父節點
當前提交
b7734ec232
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      core/views.py

+ 2
- 1
core/views.py 查看文件

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

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


Loading…
取消
儲存