mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
19 lines
528 B
Python
19 lines
528 B
Python
from sqlalchemy.exc import IntegrityError
|
|
|
|
from aurweb import schema
|
|
from aurweb.models.declarative import Base
|
|
|
|
|
|
class Group(Base):
|
|
__table__ = schema.Groups
|
|
__tablename__ = __table__.name
|
|
__mapper_args__ = {"primary_key": [__table__.c.ID]}
|
|
|
|
def __init__(self, **kwargs):
|
|
super().__init__(**kwargs)
|
|
if self.Name is None:
|
|
raise IntegrityError(
|
|
statement="Column Name cannot be null.",
|
|
orig="Groups.Name",
|
|
params=("NULL"),
|
|
)
|