mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 20:51:09 -05:00
Refactor code structure and remove redundant changes
This commit is contained in:
41
backend/apps/api/v1/parks/serializers.py
Normal file
41
backend/apps/api/v1/parks/serializers.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""
|
||||
Serializers for the parks API.
|
||||
"""
|
||||
|
||||
from rest_framework import serializers
|
||||
|
||||
from apps.parks.models import Park, ParkPhoto
|
||||
|
||||
|
||||
class ParkPhotoSerializer(serializers.ModelSerializer):
|
||||
"""Serializer for the ParkPhoto model."""
|
||||
|
||||
class Meta:
|
||||
model = ParkPhoto
|
||||
fields = (
|
||||
"id",
|
||||
"image",
|
||||
"caption",
|
||||
"alt_text",
|
||||
"is_primary",
|
||||
"uploaded_at",
|
||||
"uploaded_by",
|
||||
)
|
||||
|
||||
|
||||
class ParkSerializer(serializers.ModelSerializer):
|
||||
"""Serializer for the Park model."""
|
||||
|
||||
class Meta:
|
||||
model = Park
|
||||
fields = (
|
||||
"id",
|
||||
"name",
|
||||
"slug",
|
||||
"country",
|
||||
"continent",
|
||||
"latitude",
|
||||
"longitude",
|
||||
"website",
|
||||
"status",
|
||||
)
|
||||
Reference in New Issue
Block a user