Ticket #2943: patch_to_admin_modify.diff
File patch_to_admin_modify.diff, 1.0 KB (added by , 18 years ago) |
---|
-
admin_modify.py
7 7 from django.db.models.related import BoundRelatedObject 8 8 from django.conf import settings 9 9 import re 10 import string 10 11 11 12 register = template.Library() 12 13 … … 197 198 f = bound_field.field 198 199 if f.rel and isinstance(f.rel, models.ManyToManyRel) and f.rel.filter_interface: 199 200 return '<script type="text/javascript">addEvent(window, "load", function(e) {' \ 200 ' SelectFilter.init("id_%s", %r, %s, "%s"); });</script>\n' % (201 f.name, f.verbose_name, f.rel.filter_interface-1, settings.ADMIN_MEDIA_PREFIX)201 ' SelectFilter.init("id_%s", "%s", %s, "%s"); });</script>\n' % ( 202 f.name, string.replace(f.verbose_name, '"', '\\"'), f.rel.filter_interface-1, settings.ADMIN_MEDIA_PREFIX) 202 203 else: 203 204 return '' 204 205 filter_interface_script_maybe = register.simple_tag(filter_interface_script_maybe)