
- Set up project structure with FastAPI, SQLAlchemy, and Alembic - Create database models for User and Item - Implement CRUD operations for all models - Create API endpoints with validation - Add health check endpoint - Configure CORS middleware - Set up database migrations - Add comprehensive documentation in README
14 lines
288 B
Python
14 lines
288 B
Python
from typing import Any
|
|
|
|
from sqlalchemy.ext.declarative import as_declarative, declared_attr
|
|
|
|
|
|
@as_declarative()
|
|
class Base:
|
|
id: Any
|
|
__name__: str
|
|
|
|
# Generate __tablename__ automatically
|
|
@declared_attr
|
|
def __tablename__(cls) -> str:
|
|
return cls.__name__.lower() |