Spaces:
Runtime error
Runtime error
Download app/schemas/post.py from abdullah090809/FastAPI-Project: direct link, hf CLI and curl.
- Browser
- Download file 593 Bytes
-
https://huggingface.co/spaces/abdullah090809/FastAPI-Project/resolve/main/app/schemas/post.py
- Command line
-
hf download hf://spaces/abdullah090809/FastAPI-Project/app/schemas/post.py
-
curl -L -o post.py https://huggingface.co/spaces/abdullah090809/FastAPI-Project/resolve/main/app/schemas/post.py
593 Bytes
| from datetime import datetime | |
| from typing import Optional | |
| from pydantic import BaseModel | |
| from app.schemas.user import UserResponse | |
| class PostBase(BaseModel): | |
| title: str | |
| content: str | |
| published: bool = True | |
| class PostCreate(PostBase): | |
| pass | |
| class PostUpdate(BaseModel): | |
| title: Optional[str] = None | |
| content: Optional[str] = None | |
| published: Optional[bool] = None | |
| class PostResponse(PostBase): | |
| id: int | |
| created_at: datetime | |
| owner_id: int | |
| owner: UserResponse | |
| class Config: | |
| from_attributes = True | |
| class PostVote(PostResponse): | |
| votes: int |