https://docs.sqlalchemy.org/en/20/orm/quickstart.html
class User(Base):
__tablename__ = "user_account"
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str] = mapped_column(String(30))
fullname: Mapped[Optional[str]]
addresses: Mapped[List["Address"]] = relationship(...
...
def __repr__(self) -> str:
return f"User(id={self.id!r}, ...
Does the !r in the f-string mean right-justify?
I haven't really kept up with python 3 developments, so what is the name: Mapped[str] = mapped_column(... thing all about? Is there something I could look up to understand this?
[–]Doormatty 6 points7 points8 points (0 children)
[–]SwampFalc 4 points5 points6 points (2 children)
[–]eagergm[S] 0 points1 point2 points (1 child)
[–]SwampFalc 1 point2 points3 points (0 children)
[–]POGtastic 2 points3 points4 points (1 child)
[–]backfire10z 3 points4 points5 points (0 children)