文章排序
This commit is contained in:
parent
b0ea55121b
commit
35bac2297c
|
@ -16,7 +16,7 @@ class ArticleViewSet(CreateUpdateModelAMixin, ModelViewSet):
|
|||
filterset_fields = ['is_top', 'is_published']
|
||||
serializer_class = ArticleListSerializer
|
||||
search_fields = ['title', 'author']
|
||||
ordering = ['is_published', 'is_top', 'update_time']
|
||||
ordering = ['-is_published', '-is_top', '-update_time']
|
||||
|
||||
def get_serializer_class(self):
|
||||
if self.action in ['create', 'update']:
|
||||
|
|
Loading…
Reference in New Issue