Commit 05309fd3 authored by okhin's avatar okhin 🚴

Let's use djangorestframework-fsm to create appropriate methods for DRF...

Let's use djangorestframework-fsm to create appropriate methods for DRF viewset instead of custom mixins which do the same thing
parent 3fdbbf55
from django.db.models import Q
from rest_framework import viewsets, mixins
from djangorestframework_fsm.viewset_mixins import get_drf_fsm_mixin
from rp.models import Article
from .serializers import ArticleSerializer
from rp.views.articles import ArticleFilterMixin
from .mixins import get_viewset_transition_actions_mixin
ArticleMixin = get_viewset_transition_actions_mixin(Article)
from .serializers import ArticleSerializer
ArticleMixin = get_drf_fsm_mixin(Article, fieldname='status')
class ArticleViewSet(ArticleMixin, ArticleFilterMixin, viewsets.ModelViewSet):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment