You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My Base class for other tables in project looks like: class Base(orm.DeclarativeBase): pk: orm.Mapped[uuid.UUID] = orm.mapped_column( primary_key=True, default=uuid.uuid4, )
But I want to use User table:
class User(SQLAlchemyBaseUserTableUUID, Base): __tablename__ = "User" username: orm.Mapped[str]
SQLAlchemyBaseUserTableUUID already have id field, and now I get pk and id in my User table at the same time.
Question - how can I use User(SQLAlchemyBaseUserTableUUID, Base) having a non-empty base class without creating a second DeclarativeBase?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My Base class for other tables in project looks like:
class Base(orm.DeclarativeBase): pk: orm.Mapped[uuid.UUID] = orm.mapped_column( primary_key=True, default=uuid.uuid4, )
But I want to use User table:
class User(SQLAlchemyBaseUserTableUUID, Base): __tablename__ = "User" username: orm.Mapped[str]
SQLAlchemyBaseUserTableUUID already have id field, and now I get pk and id in my User table at the same time.
Question - how can I use
User(SQLAlchemyBaseUserTableUUID, Base)
having a non-empty base class without creating a second DeclarativeBase?Beta Was this translation helpful? Give feedback.
All reactions