mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add PackageKeyword SQLAlchemy ORM model
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
a7e5498197
commit
fb21015811
2 changed files with 74 additions and 0 deletions
20
aurweb/models/package_keyword.py
Normal file
20
aurweb/models/package_keyword.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from sqlalchemy.orm import mapper
|
||||
|
||||
from aurweb.db import make_relationship
|
||||
from aurweb.models.package_base import PackageBase
|
||||
from aurweb.schema import PackageKeywords
|
||||
|
||||
|
||||
class PackageKeyword:
|
||||
def __init__(self,
|
||||
PackageBase: PackageBase = None,
|
||||
Keyword: str = None):
|
||||
self.PackageBase = PackageBase
|
||||
self.Keyword = Keyword
|
||||
|
||||
|
||||
mapper(PackageKeyword, PackageKeywords, properties={
|
||||
"PackageBase": make_relationship(PackageBase,
|
||||
PackageKeywords.c.PackageBaseID,
|
||||
"keywords")
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue