Checking through the documents I found the following reference:

https://docs.djangoproject.com/en/2.0/topics/forms/media/#order-of-assets

Changed in Django 2.0:

In older versions, the assets of Media objects are concatenated rather than
merged in a way that tries to preserve the relative ordering of the
elements in each list.


I'm guessing that this is your problem.

>From what I understand in this context, the:

*<script type="text/javascript"
src="/static/plugins/codemirror/lib/codemirror.js"></script>*
import seems to be added in a previous dependent form and therefore is not
added again - you should probably check if the file is added somewhere else?

Best regards,

Andréas

2017-12-10 15:47 GMT+01:00 Marc R <[email protected]>:

> because they are specific to only a few models, particularly the loading
> scripts, and options, etc.  this worked great in Django 1.11
>
>
> On Sunday, 10 December 2017 09:36:56 UTC-5, Etienne Robillard wrote:
>
>> Why don't you simply put the javascripts into your base template without
>> using Python ?
>>
>> Etienne
>>
>> Le 2017-12-10 à 09:30, Marc R a écrit :
>>
>> I have this in my model:
>>
>> class Media:
>>         js = (
>>            * '/static/plugins/codemirror/lib/codemirror.js',*
>>             '/static/plugins/codemirror/mode/htmlmixed/htmlmixed.js',
>>             '/static/plugins/codemirror/addon/fold/foldcode.js',
>>             '/static/plugins/codemirror/addon/fold/foldgutter.js',
>>             '/static/plugins/codemirror/addon/fold/brace-fold.js',
>>             '/static/plugins/codemirror/addon/fold/indent-fold.js',
>>             '/static/plugins/codemirror/addon/fold/comment-fold.js',
>>             '/static/plugins/codemirror/addon/fold/xml-fold.js',
>>             '/static/plugins/codemirror/addon/comment/comment.js',
>>             '/static/plugins/codemirror/addon/edit/matchbrackets.js',
>>             '/static/plugins/codemirror/addon/edit/matchtags.js',
>>             '/static/plugins/codemirror/mode/javascript/javascript.js',
>>             '/static/plugins/codemirror/mode/xml/xml.js',
>>             '/static/plugins/codemirror/mode/htmlmixed/htmlmixed.js',
>>             '/static/plugins/codemirror/addon/display/fullscreen.js',
>>             '/static/js/admin/syslog/syslog_change_form.min.js'
>>         )
>>
>> which used to work as it was included in the model admin page in the
>> order it appears. However, now in Django 2.0, it appears in this order:
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/addon/fold/foldcode.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/addon/fold/foldgutter.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/addon/fold/brace-fold.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/addon/fold/indent-fold.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/addon/fold/comment-fold.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/addon/fold/xml-fold.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/addon/comment/comment.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/addon/edit/matchbrackets.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/addon/edit/matchtags.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/mode/javascript/javascript.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/mode/xml/xml.js"></script>
>> *<script type="text/javascript"
>> src="/static/plugins/codemirror/lib/codemirror.js"></script>*
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/mode/htmlmixed/htmlmixed.js"></script>
>> <script type="text/javascript" src="/static/plugins/codemirro
>> r/addon/display/fullscreen.js"></script>
>> <script type="text/javascript" src="/static/js/admin/syslog/s
>> yslog_change_form.min.js"></script>
>>
>> The issue is that the First file MUST be first as the remainder rely upon
>> it!  I'd rather not override a template file as if i change the admin
>> backend with a package i'd like this to "just work" as it did in Django 1.11
>> Is this a bug in the new way that Django includes these files (docs say
>> they made a change in how this is done, clearly it broke something that
>> worked!).
>>
>> Thanks
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/5ad93160-05c2-4251-84ad-6f8a1574b675%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/5ad93160-05c2-4251-84ad-6f8a1574b675%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> Etienne [email protected]https://www.isotopesoftware.ca/
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/8493b435-1574-4187-88f6-7f45f5dbaba6%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/8493b435-1574-4187-88f6-7f45f5dbaba6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCfTd0BBjYQsovHPx%2BS40U_dA1RA%3DYDNtBdYS3GJJFbKpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to