gealogiuya
This commit is contained in:
17
apps/geology/serializers/gallery.py
Normal file
17
apps/geology/serializers/gallery.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user