class UniProtSeq(orm.Model): __tablename__ = 'UniProtSeq' __metadata__ = self.metadata __database__ = self.database isoform = orm.String(max_length=20, primary_key=True) Pos = orm.Integer(primary_key=True) Ref = orm.String(max_length=1, primary_key=True)
class LitemallAdmin(BaseModel): __tablename__ = 'litemall_admin' username = orm.String(length=63) password = orm.String(length=63) last_login_ip = orm.String(length=63) last_login_time = orm.Datetime() avatar = orm.String(length=255)
class LitemallGoodsProduct(BaseModel): __tablename__ = 'litemall_goods_product' goods_id = orm.Integer() specification = orm.String(length=255) price = orm.Float() number = orm.Integer() url = orm.String(length=125)
class Articles(BaseModel): __tablename__ = 'articles' __database__ = database __metadata__ = metadata title = orm.String(max_length=255, allow_null=True) summary = orm.String(max_length=255, allow_null=True) views = orm.Integer(default=0) comment_num = orm.Integer(default=0) weight = orm.Integer(default=0) content = orm.Text() # txt content_html = orm.Text() # html is_hot = orm.Boolean(default=False) key_words = orm.String(max_length=255, allow_null=True) tag_id = orm.ForeignKey( Tags, allow_null=True ) user_id = orm.ForeignKey( User, allow_null=True ) def __str__(self): return self.title
class Domain(orm.Model): __tablename__ = "domains" __database__ = database __metadata__ = metadata id = orm.Integer(primary_key=True) name = orm.String(max_length=100, unique=True) registrar = orm.ForeignKey(Registrar) dns = orm.ForeignKey(DNSProvider, allow_null=True) site = orm.ForeignKey(Site, allow_null=True) waf = orm.ForeignKey(WAFProvider, allow_null=True) update_apex = orm.Boolean(default=True) update_a_records = orm.Text(default="www") google_site_verification = orm.String(max_length=64, allow_null=True) state = orm.Text(default="{}") active = orm.Boolean(default=True) async def serialize(self, full=False): r = { "id": self.id, "name": self.name, } if self.registrar.id: r["registrar"] = await self.registrar.serialize() if self.dns.id: r["dns"] = await self.dns.serialize() if self.site.id: r["site"] = await self.site.serialize() if self.waf.id: r["waf"] = await self.waf.serialize() if self.active: r["active"] = True return r
class User(app.db.Model, AuthUser): __tablename__ = "users" id = orm.Integer(primary_key=True) username = orm.String(max_length=16, unique=True) password_hash = orm.String(max_length=60) @property def display_name(self): return self.username @classmethod def create_from_token(cls, token: str): user = User(username=token) return user async def full(self): full_user = await User.objects.get(username=self.username) return full_user @classmethod def display_name_from_token(cls, token): return token def to_token(self): return self.username
class LitemallAddress(BaseModel): __tablename__ = 'litemall_address' name = orm.String(length=63) user_id = orm.Integer() address = orm.String(length=127) mobile = orm.String(length=20) is_default = orm.TinyInteger(length=1)
class User(orm.Model): __tablename__ = 'user' __database__ = database __metadata__ = metadata id = orm.Integer(primary_key=True) username = orm.String(max_length=100) password = orm.String(max_length=100)
class Person(orm.Table): firstName = orm.String() lastName = orm.String() height = orm.Float(default="Bob") age = orm.Integer(blank=True) def __repr__(self): return "<Person: %s %s>" % (self.firstName, self.lastName)
class ChannelTable(orm.Model): __tablename__ = "channels" __database__ = db __metadata__ = metadata channel_record_id = orm.Integer(primary_key=True) channel_id = orm.String(max_length=30) guild_id = orm.String(max_length=30)
class Person(orm.Table): firstName = orm.String() lastName = orm.String(choices=["Hinton", 3]) height = orm.Float(blank=True) age = orm.Integer(blank=True) def __repr__(self): return "<Person: %s %s>"%(self.firstName, self.lastName)
class IDMapping(orm.Model): __tablename__ = 'IDMapping' __metadata__ = self.metadata __database__ = self.database ftId = orm.String(max_length=20, primary_key=True) Entry = orm.String(max_length=50, primary_key=True) isoform = orm.String(max_length=50, primary_key=True) is_canonical = orm.Boolean()
class Mutation(orm.Model): __tablename__ = 'Mutation' __metadata__ = self.metadata __database__ = self.database ftId = orm.String(max_length=20, primary_key=True) Ref = orm.String(max_length=3, primary_key=True) Pos = orm.Integer(primary_key=True) Alt = orm.String(max_length=3, primary_key=True)
class LitemallComment(BaseModel): __tablename__ = 'litemall_comment' content = orm.String(length=1023) user_id = orm.Integer() good_id = orm.Integer() has_picture = orm.TinyInteger(length=1) pic_urls = orm.String(length=1023) star = orm.Integer()
class User(orm.Model): tablename = "users" registry = models fields = { "id": orm.Integer(primary_key=True), "name": orm.String(max_length=100), "language": orm.String(max_length=100, allow_null=True), }
class User(orm.Table): firstName = orm.String() lastName = orm.String() height = orm.Float(blank=True) age = orm.Integer(blank=True) def __repr__(self): return "<User: %s %s>" % (self.firstName, self.lastName)
class Penguin(orm.Model): __database__ = DATABASE __metadata__ = metadata __tablename__ = "penguins" id = orm.Integer(primary_key=True) nickname = orm.String(max_length=30, allow_null=False) swid = orm.String(max_length=40, allow_null=False, unique=True)
class Board(orm.Model): __tablename__ = 'boards' __database__ = database __metadata__ = metadata id = orm.Integer(primary_key=True) slug = orm.String(index=True, unique=True, max_length=4) title = orm.String(unique=True, max_length=24)
class Link(orm.Model): __tablename__ = "links" __database__ = database __metadata__ = metadata objects = LinkQuerySet() id = orm.Integer(primary_key=True) url = orm.String(max_length=300) hash = orm.String(max_length=20, allow_null=True)
class CopypastaTable(orm.Model): __tablename__ = "copypastas" __database__ = db __metadata__ = metadata id = orm.Integer(primary_key=True) name = orm.String(max_length=30) content = orm.String(max_length=1500) guild_id = orm.String(max_length=30)
class UniProtAnnotation(orm.Model): __tablename__ = 'UniProtAnnotation' __metadata__ = self.metadata __database__ = self.database UniProt = orm.String(max_length=50, primary_key=True) resource = orm.String(max_length=100, primary_key=True) resource_id = orm.String(max_length=200, primary_key=True) unp_beg = orm.Integer() unp_end = orm.Integer()
class WeiBo(orm.Model): __tablename__ = "weibo" __database__ = database __metadata__ = metadata id = orm.Integer(primary_key=True) title = orm.String(max_length=255, allow_null=True, allow_blank=True) publish_time = orm.String(max_length=20, allow_null=True, allow_blank=True) content = orm.Text(allow_null=True, allow_blank=True) group = orm.String(max_length=20, allow_null=True, allow_blank=True)
class SecTestSuiteA(orm.Model): __metadata__ = metadata __tablename__ = "sectestsuite" __database__ = database id = orm.String(primary_key=True, max_length=256) url = orm.String(max_length=256) created = orm.DateTime() modified = orm.DateTime() user_id = orm.String(max_length=256) origin = orm.String(max_length=50)
class User(orm.Model): __tablename__ = "users" __database__ = database __metadata__ = metadata id = orm.Integer(primary_key=True) name = orm.String(max_length=255) email = orm.String(max_length=255, unique=True) password = orm.String(max_length=255)
class Tags(BaseModel): __tablename__ = 'tags' __database__ = database __metadata__ = metadata name = orm.String(max_length=255, allow_null=True) avatar = orm.String(max_length=255, allow_null=True) def __str__(self): return self.name
class StravaAthlete(orm.Model): __tablename__ = "strava_athletes" __database__ = database __metadata__ = metadata id = orm.Integer(primary_key=True) access_token = orm.String(max_length=100) refresh_token = orm.String(max_length=100) token_expiration_datetime = orm.DateTime() backfilled = orm.Boolean(default=False)
class LitemallOrderGoods(BaseModel): __tablename__ = 'litemall_order_goods' order_id = orm.Integer() goods_id = orm.Integer() goods_name = orm.String(length=127) goods_sn = orm.String(length=63) product_id = orm.Integer() number = orm.Integer() price = orm.Float() pic_url = orm.String(length=255)
class FuelTable(orm.Model): __tablename__ = "fuels" __database__ = db __metadata__ = metadata id = orm.Integer(primary_key=True) name = orm.String(max_length=30) fuel_level = orm.Integer(minimum=0, maximum=100) reserves = orm.Float() buy_order = orm.Boolean() guild_id = orm.String(max_length=50)
class Comment(BaseModel): __tablename__ = "comment" __database__ = database __metadata__ = metadata user_id = orm.ForeignKey(User, allow_null=True) article_id = orm.ForeignKey(Articles, allow_null=True) content = orm.String(max_length=255, allow_null=True) parent_id = orm.Integer(allow_null=True) to_uid = orm.Integer(allow_null=True) level_flag = orm.String(allow_null=True, max_length=255)
class LitemallCart(BaseModel): __tablename__ = 'litemall_cart' user_id = orm.Integer() goods_id = orm.Integer() goods_sn = orm.String(length=63) goods_name = orm.String(length=127) product_id = orm.Integer() price = orm.Float() number = orm.Integer() checked = orm.TinyInteger(length=1) pic_url = orm.String(length=255)