diff options
| author | Michael Merickel <michael@merickel.org> | 2024-02-04 15:29:37 -0700 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2024-02-04 15:29:37 -0700 |
| commit | d3c8d93cfb1282f328ecd133df6565a2df92779f (patch) | |
| tree | d8dc3c489fa007666476ea38155d9bd24d24525c /docs/tutorials/wiki2/src/models | |
| parent | 569f0a53d0bedecceb1365a0159c9fe514f198a9 (diff) | |
| download | pyramid-d3c8d93cfb1282f328ecd133df6565a2df92779f.tar.gz pyramid-d3c8d93cfb1282f328ecd133df6565a2df92779f.tar.bz2 pyramid-d3c8d93cfb1282f328ecd133df6565a2df92779f.zip | |
update the definingviews chapter
Diffstat (limited to 'docs/tutorials/wiki2/src/models')
| -rw-r--r-- | docs/tutorials/wiki2/src/models/tutorial/models/page.py | 2 | ||||
| -rw-r--r-- | docs/tutorials/wiki2/src/models/tutorial/models/user.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/docs/tutorials/wiki2/src/models/tutorial/models/page.py b/docs/tutorials/wiki2/src/models/tutorial/models/page.py index 5a1c885c9..6cc9aae3c 100644 --- a/docs/tutorials/wiki2/src/models/tutorial/models/page.py +++ b/docs/tutorials/wiki2/src/models/tutorial/models/page.py @@ -13,4 +13,4 @@ class Page(Base): data: Mapped[str] creator_id: Mapped[int] = mapped_column(ForeignKey('users.id')) - creator: Mapped['User'] = relationship('User', back_populates='created_pages') + creator: Mapped['User'] = relationship(back_populates='created_pages') diff --git a/docs/tutorials/wiki2/src/models/tutorial/models/user.py b/docs/tutorials/wiki2/src/models/tutorial/models/user.py index d85d890c6..926a66e64 100644 --- a/docs/tutorials/wiki2/src/models/tutorial/models/user.py +++ b/docs/tutorials/wiki2/src/models/tutorial/models/user.py @@ -1,6 +1,6 @@ import bcrypt from sqlalchemy.orm import Mapped, mapped_column, relationship -from typing import Optional +from typing import List, Optional from .meta import Base @@ -24,4 +24,4 @@ class User(Base): return bcrypt.checkpw(pw.encode('utf8'), expected_hash) return False - created_pages: Mapped['Page'] = relationship('Page', back_populates='creator') + created_pages: Mapped[List['Page']] = relationship(back_populates='creator') |
