1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00
royalnet/keipack/tables/keiunlocks.py

35 lines
866 B
Python
Raw Normal View History

2019-12-20 18:41:40 +00:00
from typing import *
from sqlalchemy import *
2019-12-23 13:27:37 +00:00
from sqlalchemy.orm import relationship
2019-12-20 18:41:40 +00:00
from sqlalchemy.ext.declarative import declared_attr
from .keipeople import KeiPerson
if TYPE_CHECKING:
from royalnet.backpack.tables import User
class KeiUnlocks:
__tablename__ = "keiunlocks"
@declared_attr
def unlocks_id(self) -> int:
return Column(Integer, primary_key=True)
@declared_attr
def eris_id(self) -> str:
return Column(String, ForeignKey("keipeople.kpid"))
@declared_attr
def eris(self) -> "KeiPerson":
return relationship("KeiPerson", foreign_keys=self.eris_id)
2019-12-23 13:27:37 +00:00
@declared_attr
def rygryg_id(self) -> str:
return Column(String, ForeignKey("keipeople.kpid"))
@declared_attr
def rygryg(self) -> "KeiPerson":
return relationship("KeiPerson", foreign_keys=self.rygryg_id)