Re: Access to choice-value-constants from templates when using IntegerChoices

2020-01-29 Thread Integr@te System
Hi Dick, Consider declaring model field by: https://docs.djangoproject.com/en/3.0/ref/models/fields/#field-choices-named-groups and template settings On Thu, Jan 30, 2020, 02:13 Bernhard Dick wrote: > Hi, > > I'm having trouble with the template-side when I'm converting my code to > make

Access to choice-value-constants from templates when using IntegerChoices

2020-01-29 Thread Bernhard Dick
Hi, I'm having trouble with the template-side when I'm converting my code to make use of the in version 3 introduced IntegerChoices-Class and I'd like to get some tips on doing it right. My version 2 Code looks like this: class StateModel(models.Model): STATE_DRAFT = 0 STATE_PUBLISHED