Maybe the choices should beSTATUS = [ ('draft', _('Draft')), ...]I think
the migration system might detect a change in the model every time it is run
because the get_text_lazy() function can return a non-static result. Not sure
about that.I haven't used _() myself but I have used methods to fill up choices
lists with just that outcome. I had to finalize the list prior to running
migrate.Not much help I knowGood luckMike
-------- Original message --------From: Yves de Champlain <[email protected]>
Date: 23/2/20 15:47 (GMT+10:00) To: Django users
<[email protected]> Subject: get_FOO_display not working ? HiI'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 => drafta.get_status_display =>
draftinstead ofa.status => drafta.get_status_display => DraftThanks 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.
--
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/5e522a9f.1c69fb81.cae91.b7f5SMTPIN_ADDED_MISSING%40gmr-mx.google.com.