init
Some checks failed
CI/CD / Backend & Frontend Checks (push) Has been cancelled
CI/CD / Deploy to Production (push) Has been cancelled

This commit is contained in:
2026-05-18 11:34:07 +03:30
commit 7a8ddeabed
279 changed files with 37390 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
"""Schemas for gallery resources."""
from ninja import Schema, ModelSchema
from typing import Optional
from api.schemas.blog import AuthorSchema
from gallery.models import Gallery
class GallerySchema(ModelSchema):
"""Serialized representation of a gallery image."""
uploaded_by: AuthorSchema
file_size_mb: float
markdown_url: str
class Config:
model = Gallery
model_fields = ['id', 'title', 'description', 'image', 'alt_text',
'width', 'height', 'is_public', 'created_at']
class GalleryCreateSchema(Schema):
"""Payload for creating a gallery entry."""
title: str
description: Optional[str] = None
alt_text: Optional[str] = None
is_public: bool = True