是否可以更改管理页面中django models.py中定义的常量?

时间:2016-05-06 11:53:16

标签: django django-models django-admin

class Parameters(DateTimeBase):

    SIMPLE = 1
    MEDIUM = 2
    VERY_CUT_UP = 3
    COMPLEXITY_CHOICES = (
        (SIMPLE, 'Simple roof'),
        (MEDIUM, 'Medium difficulty'),
        (VERY_CUT_UP, 'Very cut-up roof'),
    )
   complexity = models.IntegerField(choices=COMPLEXITY_CHOICES, default=SIMPLE)

0 个答案:

没有答案