how to modify choices on admin pages - django

后端 未结 4 772
猫巷女王i
猫巷女王i 2020-12-15 11:27

I have a model that has a field named \"state\":

class Foo(models.Model):
    ...
    state = models.IntegerField(choices = STATES)
    ...

4条回答
  •  不思量自难忘°
    2020-12-15 12:17

    I see what you're trying to do, but why not just display all of them and if the person picks the (already set) current state, just don't change anything?

    you could also just build a view with a form to provide this functionality

提交回复
热议问题