gitea_push2qq/models.py

19 lines
620 B
Python
Raw Permalink Normal View History

2023-12-20 04:53:13 +08:00
from tortoise import fields
from tortoise.models import Model
class User(Model):
2023-12-20 20:47:07 +08:00
id = fields.BigIntField(pk=True, autoincrement=False)
2023-12-20 04:53:13 +08:00
name = fields.CharField(max_length=60)
2023-12-20 20:47:07 +08:00
state = fields.CharField(max_length=60)
2023-12-20 23:29:54 +08:00
gitea_users = fields.ReverseRelation['GiteaUser']
2023-12-20 04:53:13 +08:00
class GiteaUser(Model):
2023-12-20 20:47:07 +08:00
id = fields.BigIntField(pk=True, autoincrement=False)
2023-12-20 23:29:54 +08:00
qid: fields.ForeignKeyRelation[User] = fields.ForeignKeyField(
'models.User', related_name='gitea_users')
name = fields.CharField(max_length=60)
ac_tk = fields.CharField(max_length=2048)
rfs_tk = fields.CharField(max_length=2048)