1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

newforms: Changed Form.as_table() to display errors in same <td> as the field

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2006-12-26 23:16:16 +00:00
parent 247fdc19ad
commit 30c2bffe17
2 changed files with 11 additions and 21 deletions

View File

@@ -114,7 +114,7 @@ class BaseForm(StrAndUnicode):
def as_table(self):
"Returns this form rendered as HTML <tr>s -- excluding the <table></table>."
return self._html_output(u'<tr><th>%(label)s</th><td>%(field)s</td></tr>', u'<tr><td colspan="2">%s</td></tr>', '</td></tr>', True)
return self._html_output(u'<tr><th>%(label)s</th><td>%(errors)s%(field)s</td></tr>', u'<tr><td colspan="2">%s</td></tr>', '</td></tr>', False)
def as_ul(self):
"Returns this form rendered as HTML <li>s -- excluding the <ul></ul>."