django-orchestra-test/orchestra/apps/mails/api.py

23 lines
571 B
Python
Raw Normal View History

2014-08-22 15:31:44 +00:00
from rest_framework import viewsets
from orchestra.api import router
from orchestra.apps.accounts.api import AccountApiMixin
from .models import Address, Mailbox
from .serializers import AddressSerializer, MailboxSerializer
class AddressViewSet(AccountApiMixin, viewsets.ModelViewSet):
model = Address
serializer_class = AddressSerializer
class MailboxViewSet(AccountApiMixin, viewsets.ModelViewSet):
model = Mailbox
serializer_class = MailboxSerializer
router.register(r'mailboxes', MailboxViewSet)
router.register(r'addresses', AddressViewSet)