﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21318	Clarify the ordering of the various Media classes	leandro.gz73@…	nobody	"I'm using django 1.5.4

I've got a custom user model, with ManyToManyField called 'favorite_bands'.
I'd like to use [http://ivaynberg.github.io/select2/] widget.
This includes some js files, but I need to include a jquery library higher than 1.4.
If I user the MEDIA class [https://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-asset-definitions], this do not ensure me the needed order (first jquery.1.10, then anothers).

I've done this: [http://stackoverflow.com/questions/1164358/django-admin-custom-javascript-load-order]

Can you add a 'pre_media' var in AdminModel to set a user ordered list of js and render them before 'media' var? Or add it to MEDIA class?
That could be a solution. 

This is the relevant part of code

{{{

{% block extrahead %}{{ block.super }}
<script type=""text/javascript"" src=""{% url 'admin:jsi18n' %}""></script>
<script type=""text/javascript"" src=""{{ STATIC_URL }}js/jquery/jquery-1.10.1.js""></script>
{# I've inserted the jquery version, I'd like to have a var 'pre_media' var here #}
{{ media }}
{% endblock %}
}}}



{{{
class UserChangeForm(forms.ModelForm):

    class Meta:
        model = get_user_model()
        widgets = {
            'favorite_bands': HeavySelect2MultipleWidget(
                data_view='search_bands', select2_options={
                    'width': 600,
                    'closeOnSelect': True
                }),         
        }
}}}"	Cleanup/optimization	closed	Documentation	dev	Normal	duplicate	admin, js, jquery		Accepted	0	0	0	0	0	0
