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")
