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