base.py 425 B

1234567891011121314151617
  1. from __future__ import annotations
  2. from pydantic import ConfigDict
  3. from sqlmodel import SQLModel
  4. class TableModel(SQLModel, table=False):
  5. """Base model for database tables with common fields.
  6. This is a mixin class that should not be used directly.
  7. Subclasses must set table=True explicitly.
  8. """
  9. model_config = ConfigDict(
  10. validate_assignment=True,
  11. from_attributes=True,
  12. )