mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 12:11:13 -05:00
42 lines
829 B
Python
42 lines
829 B
Python
"""
|
|
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",
|
|
)
|