Active Session
This model is used to store active session for users. It has a one-to-one relationship with User
model. If multiple session is not allowed, user has to login again on any new device.
Bases: Base
Active session model
This model is used to store active session for users. It has a one-to-one relationship with User
model. If multiple session is not allowed, user has to login again on any new device.
Bases: Base
Active session model
FasterAPI\models.py
__tablename__ = 'active_sessions'
class-attribute
instance-attribute
client: Mapped[str]
instance-attribute
exp: Mapped[datetime]
instance-attribute
id: Mapped[int] = mapped_column(primary_key=True, index=True)
class-attribute
instance-attribute
user: Mapped[User] = relationship('User', back_populates='session')
class-attribute
instance-attribute
username: Mapped[str] = mapped_column(ForeignKey('users.username'), index=True, unique=True)
class-attribute
instance-attribute