mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add PackageBlacklist SQLAlchemy ORM model
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
163e4d7389
commit
511f174c8b
2 changed files with 54 additions and 0 deletions
20
aurweb/models/package_blacklist.py
Normal file
20
aurweb/models/package_blacklist.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from sqlalchemy import Column, Integer
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
|
||||
from aurweb.models.declarative import Base
|
||||
|
||||
|
||||
class PackageBlacklist(Base):
|
||||
__tablename__ = "PackageBlacklist"
|
||||
|
||||
ID = Column(Integer, primary_key=True)
|
||||
|
||||
__mapper_args__ = {"primary_key": [ID]}
|
||||
|
||||
def __init__(self, Name: str = None):
|
||||
self.Name = Name
|
||||
if not self.Name:
|
||||
raise IntegrityError(
|
||||
statement="Column Name cannot be null.",
|
||||
orig="PackageBlacklist.Name",
|
||||
params=("NULL"))
|
Loading…
Add table
Add a link
Reference in a new issue