38 lines
663 B
Python
38 lines
663 B
Python
from ninja import Schema
|
|
from datetime import datetime
|
|
from typing import Optional, List
|
|
|
|
|
|
class LinkCategorySchema(Schema):
|
|
id: int
|
|
name: str
|
|
code: str
|
|
order: int
|
|
is_active: bool
|
|
created_at: Optional[datetime] = None
|
|
|
|
|
|
class FriendLinkSchema(Schema):
|
|
id: int
|
|
category_id: int
|
|
name: str
|
|
url: str
|
|
order: int
|
|
is_active: bool
|
|
created_at: Optional[datetime] = None
|
|
|
|
|
|
class LinkCategoryCreateSchema(Schema):
|
|
name: str
|
|
code: str
|
|
order: int = 0
|
|
is_active: bool = True
|
|
|
|
|
|
class FriendLinkCreateSchema(Schema):
|
|
category_id: int
|
|
name: str
|
|
url: str
|
|
order: int = 0
|
|
is_active: bool = True
|