diff --git a/orm.py b/orm.py new file mode 100644 index 0000000..412d324 --- /dev/null +++ b/orm.py @@ -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')