Files
backend/apps/geology/serializers/gallery.py
A'zamov Samandar 0229a0595c
Some checks failed
Deploy Django Application to Server / deploy (push) Failing after 19s
Telegram Notifications / Telegram Gate (push) Failing after 5s
gealogiuya
2026-02-27 14:56:23 +05:00

18 lines
472 B
Python

from rest_framework import serializers
from apps.geology.models import Gallery, GalleryCategory
class GallerySerializer(serializers.ModelSerializer):
class Meta:
model = Gallery
fields = "__all__"
class GalleryCategorySerializer(serializers.ModelSerializer):
gallery = GallerySerializer(many=True, read_only=True)
class Meta:
model = GalleryCategory
fields = ("id", "name", "count", "gallery", "created_at", "updated_at")