#12265: Media (js/css) collection strategy in Forms has no order dependence 
concept
----------------------------------------+----------------------
               Reporter:  tblanchard@…  |        Owner:  nobody
                 Status:  new           |    Milestone:
              Component:  Forms         |      Version:  1.1
             Resolution:                |     Keywords:
           Triage Stage:  Accepted      |    Has patch:  0
    Needs documentation:  0             |  Needs tests:  0
Patch needs improvement:  0             |
----------------------------------------+----------------------

Comment (by alexr):

 I think this is a combination of issues.

 1) The user wants to use a django admin widget outside of the admin. Since
 the widgets don't include all of the media that they need, he is needing
 to add some extra js and css to the media definition.
 http://stackoverflow.com/questions/38601/using-django-time-date-widgets-
 in-custom-form/719583#719583

 2) Adding the js and css to the form media class isn't working because the
 media from the fields is added before the media from the form.

 The solution is to add the js and css to the template before the form, but
 that is really a hack to work around the fact that he can't define media
 in his class to do what he needs. He could also subclass the admin widgets
 and add the required media to the fields.

 Solutions:

 1) Make the admin widgets contain all the media they need within their own
 media definition.

 2) Change the admonition on this page to give a better explanation of some
 of the pitfalls of using admin widgets.
 http://docs.djangoproject.com/en/dev/topics/forms/media/#s-form-media

 3) Document the order that media is combined. (Fields, in field order,
 then form media added.)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12265#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to