2014-05-08 16:59:35 +00:00
|
|
|
from rest_framework import viewsets
|
|
|
|
|
2015-04-05 18:02:36 +00:00
|
|
|
from orchestra.api import router, SetPasswordApiMixin, LogApiMixin
|
2015-04-05 10:46:24 +00:00
|
|
|
from orchestra.contrib.accounts.api import AccountApiMixin
|
2014-05-08 16:59:35 +00:00
|
|
|
|
|
|
|
from .models import List
|
|
|
|
from .serializers import ListSerializer
|
|
|
|
|
|
|
|
|
2015-04-05 18:02:36 +00:00
|
|
|
class ListViewSet(LogApiMixin, AccountApiMixin, SetPasswordApiMixin, viewsets.ModelViewSet):
|
2015-04-23 14:34:04 +00:00
|
|
|
queryset = List.objects.all()
|
2014-05-08 16:59:35 +00:00
|
|
|
serializer_class = ListSerializer
|
2021-01-13 15:41:36 +00:00
|
|
|
filter_fields = ('name', 'address_domain')
|
2014-05-08 16:59:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
router.register(r'lists', ListViewSet)
|