models.py 740 B

12345678910111213141516171819202122232425
  1. from tortoise.models import Model
  2. from tortoise.fields import IntField, BigIntField, CharField, TextField, ForeignKeyField
  3. class Action(Model):
  4. id = IntField(pk=True)
  5. name = CharField(max_length=64, unique=True)
  6. template = TextField()
  7. class Gif(Model):
  8. id = IntField(pk=True)
  9. action = ForeignKeyField('models.Action', related_name='gifs')
  10. file_id = CharField(max_length=64, unique=True)
  11. class UserColor(Model):
  12. id = IntField(pk=True)
  13. username = CharField(max_length=256, unique=True)
  14. color = IntField()
  15. class StickerPack(Model):
  16. id = IntField(pk=True)
  17. short_name = CharField(max_length=256, unique=True)
  18. sid = BigIntField()
  19. hash = BigIntField()
  20. stickers_count = IntField(default=0)