mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
newforms-admin: Fixed #7391 -- Mark the output of BaseFormSet.as_table safe. Thanks akaihola!
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7587 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
453d560a94
commit
65ef8d4da7
@ -1,5 +1,6 @@
|
|||||||
from forms import Form
|
from forms import Form
|
||||||
from django.utils.encoding import StrAndUnicode
|
from django.utils.encoding import StrAndUnicode
|
||||||
|
from django.utils.safestring import mark_safe
|
||||||
from fields import IntegerField, BooleanField
|
from fields import IntegerField, BooleanField
|
||||||
from widgets import Media, HiddenInput, TextInput
|
from widgets import Media, HiddenInput, TextInput
|
||||||
from util import ErrorList, ValidationError
|
from util import ErrorList, ValidationError
|
||||||
@ -258,7 +259,7 @@ class BaseFormSet(StrAndUnicode):
|
|||||||
# probably should be. It might make sense to render each form as a
|
# probably should be. It might make sense to render each form as a
|
||||||
# table row with each field as a td.
|
# table row with each field as a td.
|
||||||
forms = u' '.join([form.as_table() for form in self.forms])
|
forms = u' '.join([form.as_table() for form in self.forms])
|
||||||
return u'\n'.join([unicode(self.management_form), forms])
|
return mark_safe(u'\n'.join([unicode(self.management_form), forms]))
|
||||||
|
|
||||||
# XXX: This API *will* change. Use at your own risk.
|
# XXX: This API *will* change. Use at your own risk.
|
||||||
def _formset_factory(form, formset=BaseFormSet, extra=1, can_order=False, can_delete=False):
|
def _formset_factory(form, formset=BaseFormSet, extra=1, can_order=False, can_delete=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user