feat: paper list添加两个筛选条件

This commit is contained in:
caoqianming 2026-01-31 09:53:56 +08:00
parent f7d14634f8
commit d813a53652
1 changed files with 2 additions and 1 deletions

View File

@ -9,7 +9,8 @@ from rest_framework.permissions import AllowAny
class PaperViewSet(CustomGenericViewSet, CustomListModelMixin): class PaperViewSet(CustomGenericViewSet, CustomListModelMixin):
queryset = Paper.objects.all() queryset = Paper.objects.all()
serializer_class = PaperListSerializer serializer_class = PaperListSerializer
filterset_fields = ["publication_year", "type", "fetch_status"] filterset_fields = ["publication_year", "type", "fetch_status",
"has_abstract", "has_fulltext"]
search_fields = ['title', 'first_author', 'first_author_institution'] search_fields = ['title', 'first_author', 'first_author_institution']
ordering = ["-publication_date", "-create_time"] ordering = ["-publication_date", "-create_time"]