mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-05 05:37:50 +02:00
Add consists API
This commit is contained in:
@@ -1,3 +1,21 @@
|
||||
from django.shortcuts import render
|
||||
from rest_framework.generics import ListAPIView, RetrieveAPIView
|
||||
|
||||
# Create your views here.
|
||||
from consist.models import Consist
|
||||
from consist.serializers import ConsistSerializer
|
||||
|
||||
|
||||
class ConsistList(ListAPIView):
|
||||
queryset = Consist.objects.all()
|
||||
serializer_class = ConsistSerializer
|
||||
|
||||
|
||||
class ConsistGet(RetrieveAPIView):
|
||||
queryset = Consist.objects.all()
|
||||
serializer_class = ConsistSerializer
|
||||
lookup_field = "uuid"
|
||||
|
||||
|
||||
# class RosterIdentifier(RetrieveAPIView):
|
||||
# queryset = RollingStock.objects.all()
|
||||
# serializer_class = RollingStockSerializer
|
||||
# lookup_field = "identifier"
|
||||
|
Reference in New Issue
Block a user