On Tue, Jun 23, 2009 at 10:22 PM, buttman <cp368...@ohio.edu> wrote:

>
> Yes, but {% with %} isn't placing anything anywhere. It's just
> creating a new variable "object" from "form.instance". My only options
> seems to be either stuck using form.instance, or place a {% with %}
> tag inside each and every {% block %} that needs it (which is just
> about every one). I don't like either option :(
>

It may not be placing anything anywhere but it itself has to be placed
somewhere and if it is not inside a block there is no place for it to go.
All that happens with child templates is that the defined blocks are
substituted into the parent template to over-ride whatever may have been
specified there.  Then the ultimate parent template, after all over-ridden
blocks have been substituted, is rendered.  (I do not know if that is
exactly how it is implemented, but that is how it works conceptually.)
Anything outside of a {% block %} in a child template has no place to go in
the ultimately rendered template.

You seem to have left out of your options the choice of putting the {% with
%} block in the parent template?  Or passing your variables in the context
with the names you'd like to use in the template blocks?

Karen

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