Reverse of admin:jsi18n

78 views
Skip to first unread message

Dan Gentry

unread,
Nov 8, 2012, 10:03:58 AM11/8/12
to django...@googlegroups.com
Using Django 1.3, I'm declaring a javascript file in the Media class of a ModelForm.  For the jsi18n javascript catalog, the examples show the path hard coded:

    js = ('/admin/jsi18n/')

However, I want to make this a little more portable by replacing the path with a reverse() call.  I tried this:

    js = (reverse('admin:jsi18n'))

which failed when the form was imported.  However, I can use the same argument in a URL call in the template:

    {% url 'admin:jsi18n' %}

Any advice on how I can use reverse() in the Media class?  I haven't found anything helpful in my searches.

Thanks,

Dan Gentry

Dan Gentry

unread,
Nov 8, 2012, 10:09:34 AM11/8/12
to django...@googlegroups.com
Correction:

My URL tag does not include the quotes.  Should be:
Reply all
Reply to author
Forward
0 new messages