mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
28 lines
750 B
Python
28 lines
750 B
Python
from rest_framework.generics import ListAPIView, RetrieveAPIView
|
|
|
|
from roster.models import RollingStock
|
|
from roster.serializers import RollingStockSerializer
|
|
|
|
|
|
class RosterList(ListAPIView):
|
|
queryset = RollingStock.objects.all()
|
|
serializer_class = RollingStockSerializer
|
|
|
|
|
|
class RosterGet(RetrieveAPIView):
|
|
queryset = RollingStock.objects.all()
|
|
serializer_class = RollingStockSerializer
|
|
lookup_field = 'uuid'
|
|
|
|
|
|
class RosterAddress(RetrieveAPIView):
|
|
queryset = RollingStock.objects.all()
|
|
serializer_class = RollingStockSerializer
|
|
lookup_field = 'address'
|
|
|
|
|
|
class RosterIdentifier(RetrieveAPIView):
|
|
queryset = RollingStock.objects.all()
|
|
serializer_class = RollingStockSerializer
|
|
lookup_field = 'identifier'
|