MCPcopy Create free account
hub / github.com/binkuolo/fastapi / User

Class User

models/base.py:37–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36
37class User(TimestampMixin):
38 role: fields.ManyToManyRelation["Role"] = \
39 fields.ManyToManyField("base.Role", related_name="user", on_delete=fields.CASCADE)
40 username = fields.CharField(null=True, max_length=20, description="用户名")
41 user_type = fields.BooleanField(default=False, description="用户类型 True:超级管理员 False:普通管理员")
42 password = fields.CharField(null=True, max_length=255)
43 nickname = fields.CharField(default='binkuolo', max_length=255, description='昵称')
44 user_phone = fields.CharField(null=True, description="手机号", max_length=11)
45 user_email = fields.CharField(null=True, description='邮箱', max_length=255)
46 full_name = fields.CharField(null=True, description='姓名', max_length=255)
47 user_status = fields.IntField(default=0, description='0未激活 1正常 2禁用')
48 header_img = fields.CharField(null=True, max_length=255, description='头像')
49 sex = fields.IntField(default=0, null=True, description='0未知 1男 2女')
50 remarks = fields.CharField(null=True, max_length=30, description="备注")
51 client_host = fields.CharField(null=True, max_length=19, description="访问IP")
52 wechat: fields.OneToOneRelation[UserWechat]
53
54 class Meta:
55 table_description = "用户表"
56 table = "user"
57
58
59class Role(TimestampMixin):

Callers 1

check_permissionsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected