core(major): add api for most simple objects
This commit is contained in:
19
passbook/core/api/applications.py
Normal file
19
passbook/core/api/applications.py
Normal file
@ -0,0 +1,19 @@
|
||||
from rest_framework.serializers import ModelSerializer
|
||||
from rest_framework.viewsets import ModelViewSet
|
||||
|
||||
from passbook.core.models import Application
|
||||
|
||||
|
||||
class ApplicationSerializer(ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
|
||||
model = Application
|
||||
fields = ['pk', 'name', 'slug', 'launch_url', 'icon_url',
|
||||
'provider', 'policies', 'skip_authorization']
|
||||
|
||||
|
||||
class ApplicationViewSet(ModelViewSet):
|
||||
|
||||
queryset = Application.objects.all()
|
||||
serializer_class = ApplicationSerializer
|
||||
Reference in New Issue
Block a user