On Jun 22, 2008, at 11:00 AM, Kenneth McDonald wrote:
>
> Notice the call on "greeting.key()". However, unless I'm missing
> something, there is no way to actually invoke a method from within a
> Django template.

Hi Kenneth,

Leaving the parentheses off after greeting.key will actually result in  
the method call you're looking for. The way Django's templates work, a  
dotted-notation attribute like that can be interpreted as a dictionary  
lookup, data attribute, a method call and list index – the template  
parser will try all of those, in that order. So long as the method  
doesn't require arguments, it will get called as expected.

http://www.djangoproject.com/documentation/templates/#variables

Eric
--~--~---------~--~----~------------~-------~--~----~
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