On Feb 6, 2010, at 2:53 AM, Atamert Ölçgen wrote:

> 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.
> 
> 

What about the verbose_name and help_text of each field in the model?

I want to use the verbose_name in a list view table column header.

Is there a way to get the verbose_name from a QuerySet?

--
Eric Chamberlain




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

Reply via email to