On 9/10/2014 1:58 PM, 6233114 6233114 wrote:
>
> *How do I display the text value of the saved select list value?*
>
> For example if the user has saved 2 as the achievement_type, how do I
> display *Academic Achievement* and not the number 2.
Easy ...
https://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.get_FOO_display
>
> I have tried the following line of code, but this only returns *(2, )*
> *
> *
> *
> |
> ad.achievement_type_as_text =
> AchievementDetails.ACHIEVEMENT_TYPES[ad.achievement_type]
> |
>
> *
--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5435FFEC.4090003%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment