Ticket #7828: unnecessary_imports.diff
File unnecessary_imports.diff, 1.7 KB (added by , 16 years ago) |
---|
-
django/django/contrib/admin/widgets.py
27 27 super(FilteredSelectMultiple, self).__init__(attrs, choices) 28 28 29 29 def render(self, name, value, attrs=None, choices=()): 30 from django.conf import settings31 30 output = [super(FilteredSelectMultiple, self).render(name, value, attrs, choices)] 32 31 output.append(u'<script type="text/javascript">addEvent(window, "load", function(e) {') 33 32 # TODO: "id_" is hard-coded here. This should instead use the correct … … 85 84 super(AdminFileWidget, self).__init__(attrs) 86 85 87 86 def render(self, name, value, attrs=None): 88 from django.conf import settings89 87 output = [] 90 88 if value: 91 89 output.append('%s <a target="_blank" href="%s%s">%s</a> <br />%s ' % \ … … 103 101 super(ForeignKeyRawIdWidget, self).__init__(attrs) 104 102 105 103 def render(self, name, value, attrs=None): 106 from django.conf import settings107 104 related_url = '../../../%s/%s/' % (self.rel.to._meta.app_label, self.rel.to._meta.object_name.lower()) 108 105 if self.rel.limit_choices_to: 109 106 url = '?' + '&'.join(['%s=%s' % (k, v) for k, v in self.rel.limit_choices_to.items()]) … … 187 184 return obj 188 185 189 186 def render(self, name, value, *args, **kwargs): 190 from django.conf import settings191 187 rel_to = self.rel.to 192 188 related_url = '../../../%s/%s/' % (rel_to._meta.app_label, rel_to._meta.object_name.lower()) 193 189 self.widget.choices = self.choices