gitea_push2qq/models.py

19 lines
620 B
Python

from tortoise import fields
from tortoise.models import Model
class User(Model):
id = fields.BigIntField(pk=True, autoincrement=False)
name = fields.CharField(max_length=60)
state = fields.CharField(max_length=60)
gitea_users = fields.ReverseRelation['GiteaUser']
class GiteaUser(Model):
id = fields.BigIntField(pk=True, autoincrement=False)
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)