MCPcopy Create free account
hub / github.com/dbunt1tled/python-fast-api / User

Class User

src/app/user/model/user.py:10–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10class User(Entity):
11 __tablename__ = "users"
12
13 id: Mapped[int] = mapped_column(
14 Integer,
15 primary_key=True,
16 )
17 first_name: Mapped[str] = mapped_column(String(70), nullable=False)
18 second_name: Mapped[str] = mapped_column(String(70), nullable=False)
19 email: Mapped[str] = mapped_column(String(100), unique=True, nullable=False)
20 status: Mapped[UserStatus] = mapped_column(IntEnum(UserStatus), nullable=False, default=UserStatus.PENDING)
21 hash_password: Mapped[str] = mapped_column(String(150), nullable=False)
22 session: Mapped[str] = mapped_column(String(50), nullable=True)
23 roles: Mapped[list] = mapped_column(JSON, nullable=False, default=list)
24 updated_at: Mapped[DateTime] = mapped_column(
25 DateTime(timezone=True),
26 server_default=func.now(),
27 onupdate=func.now(),
28 )
29 created_at: Mapped[DateTime] = mapped_column(DateTime(timezone=True), server_default=func.now())

Callers 3

signupMethod · 0.90
to_userMethod · 0.90
to_userMethod · 0.90

Calls 1

IntEnumClass · 0.90

Tested by

no test coverage detected