
- Set up project structure and FastAPI application - Create database models with SQLAlchemy - Implement authentication with JWT - Add CRUD operations for products, inventory, categories - Implement purchase order and sales functionality - Create reporting endpoints - Set up Alembic for database migrations - Add comprehensive documentation in README.md
15 lines
468 B
Python
15 lines
468 B
Python
from typing import List, Optional
|
|
|
|
from sqlalchemy.orm import Session
|
|
|
|
from app.crud.base import CRUDBase
|
|
from app.models.category import Category
|
|
from app.schemas.category import CategoryCreate, CategoryUpdate
|
|
|
|
|
|
class CRUDCategory(CRUDBase[Category, CategoryCreate, CategoryUpdate]):
|
|
def get_by_name(self, db: Session, *, name: str) -> Optional[Category]:
|
|
return db.query(Category).filter(Category.name == name).first()
|
|
|
|
|
|
category = CRUDCategory(Category) |