On Wednesday 07 June 2006 12:12, mazurin wrote:

>   I am using limoudou's 'expr' tag, btw.
>
>   In a template html file, why can I do this (very simplified
> example):
>
>     <div style="somestyle">  {{ form.somefield }}  </div>
>
>   but not this:
>
>     {% expr form.somefield as var %}
>     <div style="somestyle">  {{ var }}  </div>
>
>   The 2nd example causes Django to raise an AttributeError, saying
> "FormWrapper instance has no attribute 'somefield'."
>
>   Why can I call the somefield method from within variable expansion
> {{}} but not inside a custom tag? The reason I want to do this is I
> want to use the same template for listing some object properties as
> for displaying input fields to modify them.

This falls under the details of how {% expr %} is implemented -- every 
custom tag is free to interpret the rest of the tag however it likes.  
Obviously limoudou's does not do what you want -- you'll have to ask 
him.

Luke

-- 
The probability of someone watching you is proportional to the 
stupidity of your action.

Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/

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

Reply via email to