添加orm

This commit is contained in:
San Liy 2023-12-19 02:49:42 +08:00
parent b2db8b8574
commit da306f9b99

13
orm.py Normal file
View File

@ -0,0 +1,13 @@
from tortoise import Model, fields
class User(Model):
id = fields.IntField(pk=True)
name = fields.CharField(max_length=60)
state = fields.CharField(max_length=20)
class UserGroup(Model):
id = fields.IntField(pk=True)
name = fields.CharField(max_length=60)
user = fields.ForeignKeyField('orm.User')