On Tue, Jul 15, 2008 at 12:00 PM, Torsten Bronger
<[EMAIL PROTECTED]> wrote:
>
> Hallöchen!
>
> Arien writes:
>
>> On Tue, Jul 15, 2008 at 10:53 AM, Torsten Bronger
>> <[EMAIL PROTECTED]> wrote:
>>
>>> In a display template (not a form, just display), I write the
>>> following:
>>>
>>>    <td>{% trans 'Temperature:' %}</td>
>>>    <td>{{ layer.heating_temperature }}</td>
>>>
>>> I'd like to use the verbose_name of the model instance instead of
>>> hard-wiring the label in the template.  How can I access it?
>>
>> The verbose_name is at layer._meta.verbose_name.  You can't access
>> it like that from your template, though.
>
> Okay, thanks!  However, then what is the "official" way to do it?

Sorry for being unclear.  What I meant was that you can't use
layer._meta.verbose_name in the template, because template variables
and attributes can't start with an underscore.

You'll have to make layer._meta.verbose_name available to the template
under some other name.


Arien

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to