13 lines
390 B
Python
13 lines
390 B
Python
from sqlalchemy import Column, Integer, String
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base_class import Base
|
|
|
|
|
|
class Category(Base):
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String, index=True, nullable=False)
|
|
description = Column(String, nullable=True)
|
|
|
|
# Relationships
|
|
products = relationship("Product", back_populates="category") |