Add direct-save public content API
This commit is contained in:
85
apps/content/api/schemas.py
Normal file
85
apps/content/api/schemas.py
Normal file
@@ -0,0 +1,85 @@
|
||||
from typing import Literal, Optional, Union
|
||||
|
||||
from ninja import Schema
|
||||
|
||||
|
||||
class MediaOut(Schema):
|
||||
url: str
|
||||
alt: str
|
||||
|
||||
|
||||
class SeoOut(Schema):
|
||||
title: str
|
||||
description: str
|
||||
image: Optional[MediaOut] = None
|
||||
|
||||
|
||||
class SiteContentOut(Schema):
|
||||
official_name: str
|
||||
short_name: str
|
||||
faculty_subline: str
|
||||
description: str
|
||||
logo: Optional[MediaOut] = None
|
||||
navigation: dict[str, str]
|
||||
contacts: dict[str, str]
|
||||
address: str
|
||||
footer_copy: str
|
||||
seo: SeoOut
|
||||
|
||||
|
||||
class PageBaseOut(Schema):
|
||||
slug: str
|
||||
title: str
|
||||
intro: str
|
||||
seo: SeoOut
|
||||
|
||||
|
||||
class HomePageOut(PageBaseOut):
|
||||
slug: Literal["home"]
|
||||
hero_heading: str
|
||||
hero_body: str
|
||||
hero_image: Optional[MediaOut] = None
|
||||
hero_action_label: str
|
||||
featured_events_heading: str
|
||||
featured_events_intro: str
|
||||
featured_events_link_label: str
|
||||
featured_posts_heading: str
|
||||
featured_posts_intro: str
|
||||
featured_posts_link_label: str
|
||||
participation_heading: str
|
||||
participation_body: str
|
||||
participation_image: Optional[MediaOut] = None
|
||||
participation_action_label: str
|
||||
|
||||
|
||||
class AboutItemOut(Schema):
|
||||
kind: str
|
||||
title: str
|
||||
text: str
|
||||
position: int
|
||||
|
||||
|
||||
class AboutPageOut(PageBaseOut):
|
||||
slug: Literal["about"]
|
||||
identity_heading: str
|
||||
identity_body: str
|
||||
mission_heading: str
|
||||
mission_body: str
|
||||
activities_heading: str
|
||||
activities_body: str
|
||||
values_heading: str
|
||||
values_body: str
|
||||
committees_heading: str
|
||||
committees_body: str
|
||||
affiliations_heading: str
|
||||
affiliations_body: str
|
||||
faq_heading: str
|
||||
contact_heading: str
|
||||
items: list[AboutItemOut]
|
||||
|
||||
|
||||
class ListingPageOut(PageBaseOut):
|
||||
slug: Literal["events", "blog"]
|
||||
|
||||
|
||||
PageContentOut = Union[HomePageOut, AboutPageOut, ListingPageOut]
|
||||
Reference in New Issue
Block a user