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)
|
|
|
|
|
|
|
|
|