diff --git a/royalpack/tables/__init__.py b/royalpack/tables/__init__.py index a15e3c13..ffd97efb 100644 --- a/royalpack/tables/__init__.py +++ b/royalpack/tables/__init__.py @@ -9,6 +9,7 @@ from .fiorygi import Fiorygi from .steam import Steam from .dota import Dota from .fiorygitransactions import FiorygiTransaction +from .brawlhalla import Brawlhalla # Enter the tables of your Pack here! available_tables = [ @@ -22,6 +23,7 @@ available_tables = [ Steam, Dota, FiorygiTransaction, + Brawlhalla, ] # Don't change this, it should automatically generate __all__ diff --git a/royalpack/tables/brawlhalla.py b/royalpack/tables/brawlhalla.py new file mode 100644 index 00000000..df90e723 --- /dev/null +++ b/royalpack/tables/brawlhalla.py @@ -0,0 +1,36 @@ +from sqlalchemy import * +from sqlalchemy.orm import * +from sqlalchemy.ext.declarative import declared_attr +import steam + + +class Brawlhalla: + __tablename__ = "brawlhalla" + + @declared_attr + def brawlhalla_id(self): + return Column(Integer, primary_key=True) + + @declared_attr + def _steamid(self): + return Column(BigInteger, ForeignKey("steam._steamid"), primary_key=True) + + @declared_attr + def steam(self): + return relationship("Steam", backref=backref("brawlhalla", uselist=False)) + + @property + def steamid(self): + return steam.SteamID(self._steamid) + + @declared_attr + def name(self): + return Column(String) + + @declared_attr + def rating_1v1(self): + return Column(Integer) + + @property + def tier_1v1(self): + return Column(String)