CHOICES =(('draft', 'Draft'), )
On Sun, Feb 23, 2020, 05:48 Yves de Champlain <[email protected]> wrote:
> Hi
>
> I'm using StatusModel from models_utils :
>
> class MetaData(TimeStampedModel, StatusModel, SoftDeletableModel):
> STATUS = Choices(('draft', _('Draft')),
> ('submitted', _('Submitted')),
> ('underreview', _('Underreview')),
> )
>
> Forms using STATUS work as expected, but when I load an object from the
> DB, I can't access the human readable data in my templates.
>
> a.status => draft
> a.get_status_display => draft
>
> instead of
>
> a.status => draft
> a.get_status_display => Draft
>
> Thanks for any hep on this !
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d7a06913-39a8-4e55-9799-ebc46cb5cde4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d7a06913-39a8-4e55-9799-ebc46cb5cde4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CALfkE84BbTc47u0TGL_PWYNXpoXjs0rsZUG4rjSBNySd8SLGyw%40mail.gmail.com.