mirror of
https://github.com/khoaliber/LetterFeed.git
synced 2026-03-07 21:29:14 +00:00
v0.1.0
This commit is contained in:
23
backend/app/schemas/entries.py
Normal file
23
backend/app/schemas/entries.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import datetime
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
class EntryBase(BaseModel):
|
||||
"""Base schema for an entry."""
|
||||
subject: str
|
||||
body: str
|
||||
|
||||
|
||||
class EntryCreate(EntryBase):
|
||||
"""Schema for creating a new entry."""
|
||||
pass
|
||||
|
||||
|
||||
class Entry(EntryBase):
|
||||
"""Schema for retrieving an entry with its ID and newsletter ID."""
|
||||
id: int
|
||||
newsletter_id: int
|
||||
received_at: datetime.datetime
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
Reference in New Issue
Block a user