
This commit includes: - Project structure setup with FastAPI and SQLite - Database models and schemas for inventory management - CRUD operations for all entities - API endpoints for product, category, supplier, and inventory management - User authentication with JWT tokens - Initial database migration - Comprehensive README with setup instructions
16 lines
460 B
Python
16 lines
460 B
Python
from sqlalchemy import Column, String, Text
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base_class import BaseClass
|
|
from app.db.base import Base
|
|
|
|
|
|
class Category(Base, BaseClass):
|
|
"""
|
|
Category model for product categorization.
|
|
"""
|
|
name = Column(String(255), unique=True, index=True, nullable=False)
|
|
description = Column(Text, nullable=True)
|
|
|
|
# Relationships
|
|
products = relationship("Product", back_populates="category") |