mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
style: Run pre-commit
This commit is contained in:
parent
b47882b114
commit
9c6c13b78a
235 changed files with 7180 additions and 5628 deletions
|
@ -10,20 +10,19 @@ from aurweb.models.user import User as _User
|
|||
class PackageNotification(Base):
|
||||
__table__ = schema.PackageNotifications
|
||||
__tablename__ = __table__.name
|
||||
__mapper_args__ = {
|
||||
"primary_key": [__table__.c.UserID, __table__.c.PackageBaseID]
|
||||
}
|
||||
__mapper_args__ = {"primary_key": [__table__.c.UserID, __table__.c.PackageBaseID]}
|
||||
|
||||
User = relationship(
|
||||
_User, backref=backref("notifications", lazy="dynamic",
|
||||
cascade="all, delete"),
|
||||
foreign_keys=[__table__.c.UserID])
|
||||
_User,
|
||||
backref=backref("notifications", lazy="dynamic", cascade="all, delete"),
|
||||
foreign_keys=[__table__.c.UserID],
|
||||
)
|
||||
|
||||
PackageBase = relationship(
|
||||
_PackageBase,
|
||||
backref=backref("notifications", lazy="dynamic",
|
||||
cascade="all, delete"),
|
||||
foreign_keys=[__table__.c.PackageBaseID])
|
||||
backref=backref("notifications", lazy="dynamic", cascade="all, delete"),
|
||||
foreign_keys=[__table__.c.PackageBaseID],
|
||||
)
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
|
@ -32,10 +31,12 @@ class PackageNotification(Base):
|
|||
raise IntegrityError(
|
||||
statement="Foreign key UserID cannot be null.",
|
||||
orig="PackageNotifications.UserID",
|
||||
params=("NULL"))
|
||||
params=("NULL"),
|
||||
)
|
||||
|
||||
if not self.PackageBase and not self.PackageBaseID:
|
||||
raise IntegrityError(
|
||||
statement="Foreign key PackageBaseID cannot be null.",
|
||||
orig="PackageNotifications.PackageBaseID",
|
||||
params=("NULL"))
|
||||
params=("NULL"),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue