class Region(db.Model): idregion = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(45), nullable=False) description = db.Column(db.String(200), nullable=False) infr1 = db.Column(db.Integer, nullable=False) infr2 = db.Column(db.Integer, nullable=False) infr3 = db.Column(db.Integer, nullable=False) infr4 = db.Column(db.Integer, nullable=False) infr5 = db.Column(db.Integer, nullable=False) infr6 = db.Column(db.Integer, nullable=False) infr7 = db.Column(db.Integer, nullable=False) infr8 = db.Column(db.Integer, nullable=False)
class Location(db.Model): idlocation = db.Column(db.Integer, primary_key=True) idregion = db.Column(db.Integer, db.ForeignKey("region.idregion"), nullable=False) region = db.relationship("Region", backref=db.backref("locationregion", lazy=True)) name = db.Column(db.String(45), nullable=False) description = db.Column(db.String(200), nullable=False) effects = db.Column(db.String(200), nullable=True) idtypelocation = db.Column(db.Integer, db.ForeignKey("typelocation.idtypelocation"), nullable=False) typelocation = db.relationship("Typelocation", backref=db.backref("locationtype", lazy=True))
class Work(db.Model): idwork = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(45), nullable=False) description = db.Column(db.String(200), nullable=False) countrycount = db.Column(db.Integer, nullable=False) count = db.Column(db.Integer, nullable=False) time = db.Column(db.Integer, nullable=False) iditem = db.Column(db.Integer, db.ForeignKey("item.iditem"), nullable=False) countryitem = db.Column(db.Integer, db.ForeignKey("item.iditem"), nullable=False) item = db.relationship("Item", backref=db.backref("workitem", lazy=True), primaryjoin='Work.iditem == Item.iditem') fcountryitem = db.relationship( "Item", backref=db.backref("workcountryitem"), lazy=True, primaryjoin='Work.countryitem == Item.iditem')
class Account(db.Model): idaccount = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(45), nullable=False) socialid = db.Column(db.Integer, nullable=False) exp = db.Column(db.BigInteger, nullable=False) img = db.Column(db.String(200), nullable=False) location = db.Column(db.Integer, db.ForeignKey("location.idlocation"), nullable=False) loc = db.relationship("Location", backref=db.backref("accountlocation", lazy=True)) def is_authenticated(self): return True def is_active(self): return True def is_anonymous(self): return False def get_id(self): return self.idaccount
class Item(db.Model): iditem = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(45), nullable=False) description = db.Column(db.String(200), nullable=False) range = db.Column(db.Integer, nullable=False) effect = db.Column(db.String(200), nullable=True)
class Armyunit(db.Model): idarmyunit = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(45), nullable=False) description = db.Column(db.String(200), nullable=False)
class Country(db.Model): idcountry = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(45), nullable=False) description = db.Column(db.String(200), nullable=False)
class Effect(db.Model): ideffect = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(45), nullable=False) description = db.Column(db.String(200), nullable=False) effects = db.Column(db.String(200), nullable=False)
class Typelocation(db.Model): idtypelocation = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(45), nullable=False) description = db.Column(db.String(200), nullable=False)