core(major): add api for most simple objects
This commit is contained in:
18
passbook/core/api/invitations.py
Normal file
18
passbook/core/api/invitations.py
Normal file
@ -0,0 +1,18 @@
|
||||
from rest_framework.serializers import ModelSerializer
|
||||
from rest_framework.viewsets import ModelViewSet
|
||||
|
||||
from passbook.core.models import Invitation
|
||||
|
||||
|
||||
class InvitationSerializer(ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
|
||||
model = Invitation
|
||||
fields = ['pk', 'expires', 'fixed_username', 'fixed_email', 'needs_confirmation']
|
||||
|
||||
|
||||
class InvitationViewSet(ModelViewSet):
|
||||
|
||||
queryset = Invitation.objects.all()
|
||||
serializer_class = InvitationSerializer
|
Reference in New Issue
Block a user