Skip to content

Commit

Permalink
docs: use mapped_column (#3512)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor-reiss authored May 18, 2024
1 parent b49de66 commit b6a640a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/usage/security/abstract-authentication-middleware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@ example here let us say it is a `SQLAlchemy <https://docs.sqlalchemy.org/>`_ mod
import uuid
from sqlalchemy import Column
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import declarative_base
from sqlalchemy.orm import declarative_base, mapped_column, Mapped
Base = declarative_base()
class User(Base):
id: uuid.UUID | None = Column(
id: Mapped[uuid.UUID | None] = mapped_column(
UUID(as_uuid=True), default=uuid.uuid4, primary_key=True
)
# ... other fields follow, but we only require id for this example
Expand Down

0 comments on commit b6a640a

Please sign in to comment.