mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
24 lines
634 B
Python
24 lines
634 B
Python
from typing import *
|
|
from sqlalchemy import *
|
|
from sqlalchemy.orm import relationship, backref
|
|
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)
|