mini-rbac/backend/models/user.py

18 lines
489 B
Python
Raw Normal View History

2022-09-12 07:22:08 +00:00
from models.common import Table, fields
2022-09-11 10:34:18 +00:00
class UserModel(Table):
"""
用户模型类 > user table
"""
username = fields.CharField(max_length=16, description="账号", unique=True)
nickname = fields.CharField(max_length=20, description="姓名", null=True)
password = fields.CharField(max_length=128, description="密码")
class Meta:
table = "sys_user"
table_description = "用户表"
# 索引
unique_together = ("username",)