django-orchestra-test/orchestra/contrib/payments/api.py

22 lines
625 B
Python
Raw Normal View History

2014-07-23 16:24:56 +00:00
from rest_framework import viewsets
from orchestra.api import router
2015-04-05 10:46:24 +00:00
from orchestra.contrib.accounts.api import AccountApiMixin
2014-07-23 16:24:56 +00:00
from .models import PaymentSource, Transaction
from .serializers import PaymentSourceSerializer, TransactionSerializer
class PaymentSourceViewSet(AccountApiMixin, viewsets.ModelViewSet):
model = PaymentSource
serializer_class = PaymentSourceSerializer
class TransactionViewSet(viewsets.ModelViewSet):
model = Transaction
serializer_class = TransactionSerializer
router.register(r'payment-sources', PaymentSourceViewSet)
router.register(r'transactions', TransactionViewSet)