1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

Add a bus

This commit is contained in:
Yohann D'ANELLO
2020-04-13 05:02:16 +02:00
parent 6242e316ae
commit 822853be66
12 changed files with 218 additions and 29 deletions

View File

@ -3,7 +3,7 @@
from rest_framework import serializers
from ..models import WEIClub
from ..models import WEIClub, Bus, BusTeam
class WEIClubSerializer(serializers.ModelSerializer):
@ -15,3 +15,25 @@ class WEIClubSerializer(serializers.ModelSerializer):
class Meta:
model = WEIClub
fields = '__all__'
class BusSerializer(serializers.ModelSerializer):
"""
REST API Serializer for Bus.
The djangorestframework plugin will analyse the model `Bus` and parse all fields in the API.
"""
class Meta:
model = Bus
fields = '__all__'
class BusTeamSerializer(serializers.ModelSerializer):
"""
REST API Serializer for Bus teams.
The djangorestframework plugin will analyse the model `BusTeam` and parse all fields in the API.
"""
class Meta:
model = BusTeam
fields = '__all__'