Ticket #8058: 8058.patch
File 8058.patch, 1.9 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/options.py
198 198 js.append('js/urlify.js') 199 199 if self.opts.get_ordered_objects(): 200 200 js.extend(['js/getElementsBySelector.js', 'js/dom-drag.js' , 'js/admin/ordering.js']) 201 if self.filter_vertical or self.filter_horizontal:202 js.extend(['js/SelectBox.js' , 'js/SelectFilter2.js'])203 201 204 202 return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js]) 205 203 media = property(_media) -
django/contrib/admin/widgets.py
17 17 """ 18 18 A SelectMultiple with a JavaScript filter interface. 19 19 20 Note that the resulting JavaScript assumes that the SelectFilter2.js21 library and its dependencies have been loaded in the HTML page.20 Note that the resulting JavaScript assumes that the jsi18n 21 catalog has been loaded in the page 22 22 """ 23 class Media: 24 js = (settings.ADMIN_MEDIA_PREFIX + "js/core.js", 25 settings.ADMIN_MEDIA_PREFIX + "js/SelectBox.js", 26 settings.ADMIN_MEDIA_PREFIX + "js/SelectFilter2.js") 27 23 28 def __init__(self, verbose_name, is_stacked, attrs=None, choices=()): 24 29 self.verbose_name = verbose_name 25 30 self.is_stacked = is_stacked … … 182 187 memo[id(self)] = obj 183 188 return obj 184 189 190 def _media(self): 191 return self.widget.media 192 media = property(_media) 193 185 194 def render(self, name, value, *args, **kwargs): 186 195 rel_to = self.rel.to 187 196 related_url = '../../../%s/%s/' % (rel_to._meta.app_label, rel_to._meta.object_name.lower())