all(major): add API for all objects
This commit is contained in:
21
passbook/factors/dummy/api.py
Normal file
21
passbook/factors/dummy/api.py
Normal file
@ -0,0 +1,21 @@
|
||||
"""DummyFactor API Views"""
|
||||
from rest_framework.serializers import ModelSerializer
|
||||
from rest_framework.viewsets import ModelViewSet
|
||||
|
||||
from passbook.factors.dummy.models import DummyFactor
|
||||
|
||||
|
||||
class DummyFactorSerializer(ModelSerializer):
|
||||
"""DummyFactor Serializer"""
|
||||
|
||||
class Meta:
|
||||
|
||||
model = DummyFactor
|
||||
fields = ['pk', 'name', 'slug', 'order', 'enabled', '__type__']
|
||||
|
||||
|
||||
class DummyFactorViewSet(ModelViewSet):
|
||||
"""DummyFactor Viewset"""
|
||||
|
||||
queryset = DummyFactor.objects.all()
|
||||
serializer_class = DummyFactorSerializer
|
Reference in New Issue
Block a user