Ticket #7391: 7391-formset-as-table-mark-safe.diff
File 7391-formset-as-table-mark-safe.diff, 983 bytes (added by , 16 years ago) |
---|
-
django/newforms/formsets.py
1 1 from forms import Form 2 2 from django.utils.encoding import StrAndUnicode 3 from django.utils.safestring import mark_safe 3 4 from fields import IntegerField, BooleanField 4 5 from widgets import Media, HiddenInput, TextInput 5 6 from util import ErrorList, ValidationError … … 258 259 # probably should be. It might make sense to render each form as a 259 260 # table row with each field as a td. 260 261 forms = u' '.join([form.as_table() for form in self.forms]) 261 return u'\n'.join([unicode(self.management_form), forms])262 return mark_safe(u'\n'.join([unicode(self.management_form), forms])) 262 263 263 264 # XXX: This API *will* change. Use at your own risk. 264 265 def _formset_factory(form, formset=BaseFormSet, extra=1, can_order=False, can_delete=False):