mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 05:11:09 -05:00
Refactor code structure and remove redundant changes
This commit is contained in:
43
backend/apps/api/v1/rides/serializers.py
Normal file
43
backend/apps/api/v1/rides/serializers.py
Normal file
@@ -0,0 +1,43 @@
|
||||
"""
|
||||
Serializers for the rides API.
|
||||
"""
|
||||
|
||||
from rest_framework import serializers
|
||||
|
||||
from apps.rides.models import Ride, RidePhoto
|
||||
|
||||
|
||||
class RidePhotoSerializer(serializers.ModelSerializer):
|
||||
"""Serializer for the RidePhoto model."""
|
||||
|
||||
class Meta:
|
||||
model = RidePhoto
|
||||
fields = (
|
||||
"id",
|
||||
"image",
|
||||
"caption",
|
||||
"alt_text",
|
||||
"is_primary",
|
||||
"photo_type",
|
||||
"uploaded_at",
|
||||
"uploaded_by",
|
||||
)
|
||||
|
||||
|
||||
class RideSerializer(serializers.ModelSerializer):
|
||||
"""Serializer for the Ride model."""
|
||||
|
||||
class Meta:
|
||||
model = Ride
|
||||
fields = (
|
||||
"id",
|
||||
"name",
|
||||
"slug",
|
||||
"park",
|
||||
"manufacturer",
|
||||
"designer",
|
||||
"type",
|
||||
"status",
|
||||
"opening_date",
|
||||
"closing_date",
|
||||
)
|
||||
Reference in New Issue
Block a user