add PackageKeyword SQLAlchemy ORM model

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-05-30 18:12:46 -07:00
parent a7e5498197
commit fb21015811
2 changed files with 74 additions and 0 deletions

View 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")
})