On Saturday 06 February 2010 12:23:16 Dennis Kaarsemaker wrote:
> On do, 2010-02-04 at 11:01 -0800, Eric Chamberlain wrote:
> > I'm using the object_list  generic view and it seems there should be a
> > way to pull the field verbose_name from the model, without having to
> > hard code the name in the template.
> 
> model_class_or_instance._meta.verbose_name
> unicode(model_class_or_instance._meta.verbose_name_plural)
> 
You can't access attributes that start with an underscore from templates. A 
custom tag or filter should do it.

Alternatively computed value of verbose_name can be passed to the view via 
extra_context. Check the docs.


-- 
Saygılarımla,
Atamert Ölçgen

 -+-
 --+
 +++

www.muhuk.com
mu...@jabber.org

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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