items.py 511 B

12345678910111213141516171819202122232425
  1. from pyplanner.database import SQLABase
  2. from pyplanner.models import Base
  3. from sqlalchemy import Column, Integer, String, Text
  4. from pydantic import BaseModel
  5. class SchemaItem(BaseModel):
  6. name: str
  7. description: str
  8. uuid: str
  9. class Item(SQLABase, Base):
  10. _schema = SchemaItem
  11. __tablename__ = 'items'
  12. id = Column(Integer, primary_key=True)
  13. name = Column(String)
  14. description = Column(Text)
  15. uuid = Column(String)
  16. __mapper_args__ = {
  17. 'with_polymorphic': '*'
  18. }