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/codemirror/addon/fold/foldcode.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/addon/fold/foldgutter.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/addon/fold/brace-fold.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/addon/fold/indent-fold.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/addon/fold/comment-fold.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/addon/fold/xml-fold.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/addon/comment/comment.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/addon/edit/matchbrackets.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/addon/edit/matchtags.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/mode/javascript/javascript.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/mode/xml/xml.js"></script>
> *<script type="text/javascript" 
> src="/static/plugins/codemirror/lib/codemirror.js"></script>*
> <script type="text/javascript" 
> src="/static/plugins/codemirror/mode/htmlmixed/htmlmixed.js"></script>
> <script type="text/javascript" 
> src="/static/plugins/codemirror/addon/display/fullscreen.js"></script>
> <script type="text/javascript" 
> src="/static/js/admin/syslog/syslog_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 django-users...@googlegroups.com <javascript:>.
> To post to this group, send email to django...@googlegroups.com 
> <javascript:>.
> 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/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 robillardtka...@yandex.com 
> <javascript:>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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to