update
This commit is contained in:
@@ -1,7 +1,17 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
|
||||
|
||||
class RoleChoices(models.TextChoices):
|
||||
SUPER = "sup er", "超级管理员"
|
||||
ADMIN = "admin", "管理员"
|
||||
NORMAL = "normal", "普通"
|
||||
|
||||
|
||||
class User(AbstractUser):
|
||||
pass
|
||||
role = models.CharField(
|
||||
max_length=20,
|
||||
choices=RoleChoices.choices,
|
||||
default=RoleChoices.NORMAL,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user