我有一个无法解决的问题,启动服务器时,会出现错误:
class CritLevel (models.IntegerChoices): AttributeError: module 'django.db.models' has no attribute 'IntegerChoices'
模型中的我的代码:
import uuid
from common.models import CommonPermissionSet
from django.core.validators import MinValueValidator
from django.db import models
from django.utils.translation import gettext_lazy as _
from. import managers
class CritLevel (models.IntegerChoices):
LOW = 1, _ ('Low')
MEDIUM = 2, _ ('Medium')
HIGH = 3, _ ('High')
class TypeElHw (models.IntegerChoices):
EL = 1, _ ('Electrical Energy')
HW = 2, _ ('Heat energy')
class OrganizationType (models.IntegerChoices):
EPO = 1, _ ('EPO')
ESO = 2, _ ('ESO')
目前没有回答
相关问题 更多 >
编程相关推荐