On Tue, Feb 10, 2009 at 6:39 PM, Kevin Audleman <kevin.audle...@gmail.com>wrote:

>
> Thanks Alex, however this is a solution at the View level, and I'm
> using a view that I didn't write. Is there also a way to do this at
> the template level?
>
> Thanks again,
> Kevin
>
> On Feb 10, 1:24 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> > On Tue, Feb 10, 2009 at 4:23 PM, Kevin Audleman <
> kevin.audle...@gmail.com>wrote:
> >
> >
> >
> >
> >
> > > Hi everyone,
> >
> > > I've set up a model that has a state field with the input set to a
> > > list of states,
> >
> > > state = models.CharField(max_length=100, blank=True,
> > > choices=US_STATE_LIST)
> >
> > > The drop-down on the edit form works great, displaying 'Alabama'  and
> > > storing AL in the database. However when I view it, I see AL. How do I
> > > get django to display the human readable name?
> >
> > > I would prefer to do this on the template level, as I'm using a view
> > > from a contributed app that I can't modify.
> >
> > > Thanks,
> > > Kevin
> >
> > http://docs.djangoproject.com/en/dev/ref/models/instances/?from=olddo...
> >
> > Alex
> >
> > --
> > "I disapprove of what you say, but I will defend to the death your right
> to
> > say it." --Voltaire
> > "The people's good is the highest law."--Cicero
> >
>
Yes, the same thing works {{ model.get_FIELD_display }}.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to