12 lines
487 B
Python
12 lines
487 B
Python
from sqlalchemy import String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from orm.entities.entity_base import EntityBase
|
|
|
|
class User(EntityBase):
|
|
__tablename__ = "users"
|
|
id: Mapped[int] = mapped_column(primary_key=True)
|
|
firstname: Mapped[str] = mapped_column(String(255))
|
|
lastname: Mapped[str] = mapped_column(String(255))
|
|
|
|
def __repr__(self) -> str:
|
|
return f"User(id={self.id!r}, firstname={self.firstname!r}, lastname={self.lastname!r})" |