mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
change(FastAPI): allow User.notified to accept a Package OR PackageBase
In addition, shorten the `package_notifications` relationship to `notifications`. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
4abbf9a917
commit
f849e8b696
4 changed files with 23 additions and 9 deletions
|
@ -15,7 +15,7 @@ class PackageNotification(Base):
|
|||
Integer, ForeignKey("Users.ID", ondelete="CASCADE"),
|
||||
nullable=False)
|
||||
User = relationship(
|
||||
"User", backref=backref("package_notifications", lazy="dynamic"),
|
||||
"User", backref=backref("notifications", lazy="dynamic"),
|
||||
foreign_keys=[UserID])
|
||||
|
||||
PackageBaseID = Column(
|
||||
|
@ -23,7 +23,7 @@ class PackageNotification(Base):
|
|||
nullable=False)
|
||||
PackageBase = relationship(
|
||||
"PackageBase",
|
||||
backref=backref("package_notifications", lazy="dynamic"),
|
||||
backref=backref("notifications", lazy="dynamic"),
|
||||
foreign_keys=[PackageBaseID])
|
||||
|
||||
__mapper_args__ = {"primary_key": [UserID, PackageBaseID]}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue