mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
* Implement a customer manager for flatpages * Implement public manager for private objects * Add support for unpublished objects in roster and consist * Add support for unpublished objects in bookshelf * Update filtering on REST views * Use uuid in urls.py * Increment version
20 lines
516 B
Python
20 lines
516 B
Python
from rest_framework.generics import ListAPIView, RetrieveAPIView
|
|
|
|
from consist.models import Consist
|
|
from consist.serializers import ConsistSerializer
|
|
|
|
|
|
class ConsistList(ListAPIView):
|
|
serializer_class = ConsistSerializer
|
|
|
|
def get_queryset(self):
|
|
return Consist.objects.get_published(self.request.user)
|
|
|
|
|
|
class ConsistGet(RetrieveAPIView):
|
|
serializer_class = ConsistSerializer
|
|
lookup_field = "uuid"
|
|
|
|
def get_queryset(self):
|
|
return Consist.objects.get_published(self.request.user)
|