Ticket #6058: autoescape-kmt.diff
File autoescape-kmt.diff, 5.2 KB (added by , 17 years ago) |
---|
-
django/newforms/widgets.py
528 528 if id_: 529 529 final_attrs = dict(final_attrs, id='%s_%s' % (id_, i)) 530 530 output.append(widget.render(name + '_%s' % i, widget_value, final_attrs)) 531 return self.format_output(output)531 return mark_safe(self.format_output(output)) 532 532 533 533 def id_for_label(self, id_): 534 534 # See the comment for RadioSelect.id_for_label() -
django/contrib/admin/options.py
101 101 yield AdminField(self.form, field, is_first=(i == 0)) 102 102 103 103 def errors(self): 104 return u'\n'.join([self.form[f].errors.as_ul() for f in self.fields])104 return mark_safe(u'\n'.join([self.form[f].errors.as_ul() for f in self.fields])) 105 105 106 106 class AdminField(object): 107 107 def __init__(self, form, field, is_first): … … 522 522 'adminform': adminForm, 523 523 'is_popup': request.REQUEST.has_key('_popup'), 524 524 'show_delete': False, 525 'media': m edia,525 'media': mark_safe(media), 526 526 'inline_admin_formsets': inline_admin_formsets, 527 527 }) 528 528 return self.render_change_form(model, c, add=True) … … 597 597 'object_id': object_id, 598 598 'original': obj, 599 599 'is_popup': request.REQUEST.has_key('_popup'), 600 'media': m edia,600 'media': mark_safe(media), 601 601 'inline_admin_formsets': inline_admin_formsets, 602 602 }) 603 603 return self.render_change_form(model, c, change=True) -
django/contrib/admin/templatetags/admin_list.py
114 114 yield {"text": header, 115 115 "sortable": True, 116 116 "url": cl.get_query_string({ORDER_VAR: i, ORDER_TYPE_VAR: new_order_type}), 117 "class_attrib": (th_classes and ' class="%s"' % ' '.join(th_classes) or '')}117 "class_attrib": mark_safe((th_classes and ' class="%s"' % ' '.join(th_classes) or ''))} 118 118 119 119 def _boolean_icon(field_val): 120 120 BOOLEAN_MAPPING = {True: 'yes', False: 'no', None: 'unknown'} -
django/contrib/admin/views/main.py
10 10 from django.http import Http404 11 11 from django.utils.encoding import force_unicode, smart_str 12 12 from django.utils.translation import ugettext 13 from django.utils.safestring import mark_safe 13 14 import operator 14 15 15 16 try: -
django/contrib/admin/widgets.py
7 7 from django.utils.text import capfirst 8 8 from django.utils.translation import ugettext as _ 9 9 from django.conf import settings 10 from django.utils.safestring import mark_safe 10 11 11 12 class FilteredSelectMultiple(forms.SelectMultiple): 12 13 """ … … 28 29 # API to determine the ID dynamically. 29 30 output.append(u'SelectFilter.init("id_%s", "%s", %s, "%s"); });</script>\n' % \ 30 31 (name, self.verbose_name.replace('"', '\\"'), int(self.is_stacked), settings.ADMIN_MEDIA_PREFIX)) 31 return u''.join(output)32 return mark_safe(''.join(output)) 32 33 33 34 class AdminDateWidget(forms.TextInput): 34 35 class Media: … … 73 74 if value: 74 75 output.append('Currently: <a target="_blank" href="%s%s">%s</a> <br>Change: ' % (settings.MEDIA_URL, value, value)) 75 76 output.append(super(AdminFileWidget, self).render(name, value, attrs)) 76 return u''.join(output)77 return mark_safe(u''.join(output)) 77 78 78 79 class ForeignKeyRawIdWidget(forms.TextInput): 79 80 """ … … 99 100 output.append('<a href="%s%s" class="related-lookup" id="lookup_id_%s" onclick="return showRelatedObjectLookupPopup(this);"> ' % \ 100 101 (related_url, url, name)) 101 102 output.append('<img src="%simg/admin/selector-search.gif" width="16" height="16" alt="Lookup"></a>' % settings.ADMIN_MEDIA_PREFIX) 102 return u''.join(output)103 return mark_safe(u''.join(output)) 103 104 #if self.change: # TODO 104 105 #output.append(' <strong>TODO</strong>') 105 106 … … 148 149 output.append(u'<a href="%sadd/" class="add-another" id="add_id_%s" onclick="return showAddAnotherPopup(this);"> ' % \ 149 150 (related_url, name)) 150 151 output.append(u'<img src="%simg/admin/icon_addlink.gif" width="10" height="10" alt="Add Another"/></a>' % settings.ADMIN_MEDIA_PREFIX) 151 return u''.join(output)152 return mark_safe(u''.join(output)) 152 153 153 154 def __deepcopy__(self, memo): 154 155 # There's no reason to deepcopy admin_site, etc, so just return self.