What about de-duping?
If two forms want the same js file, will it get included twice?
It seems like this is the kind of thing that the framework should handle and 
the current "solution" is kind of half baked.

-Todd

On Nov 23, 2009, at 2:40 PM, Mark (Nosrednakram) wrote:

> 
> Hello,
> 
> I have something like the following in my generic genericform.html.  I
> think this is what you're looking for if not hope you find a better
> answer. The extramedia block is back in my base.html  template and my
> form template extends it. I'm not sure if it's in the admin base.html
> but you can take a look at if for there media blocks I believe are
> something like extrastyle etc...
> 
> {% block extramedia %}
> {% if forms %}
>    {% for form in forms %}
>       {{ form.media }}
>    {% endfor %}
> {% else %}
>   {{ form.media }}
> {% endif %}
> 
> Mark
> 
> 
> On Nov 23, 1:31 pm, Todd Blanchard <[email protected]> wrote:
>> I've read this:
>> 
>> http://docs.djangoproject.com/en/dev/topics/forms/media/
>> 
>> Nifty.  
>> 
>> Now, how exactly do I make sure that the media urls get spewed properly into 
>> the head section of the page?  This is apparently omitted everywhere I've 
>> looked.  The admin template seems to pull it off properly but I cannot 
>> figure out how.  Seems like I should be able to do something like
>> 
>> <html>
>> <head>
>> {{ media }}  
>> </head>
>> 
>> but I cannot figure out exactly how to properly aggregate all the forms' 
>> media's and get them spewed into the templates properly.
>> 
>> -Todd
> 
> --
> 
> 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=.
> 
> 

--

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