Ticket #3108: as_dl.patch

File as_dl.patch, 769 bytes (added by webograph <webograph@…>, 8 years ago)
  • django/newforms/forms.py

     
    151151        "Returns this form rendered as HTML <p>s."
    152152        return self._html_output(u'<p>%(label)s %(field)s%(help_text)s</p>', u'<p>%s</p>', '</p>', u' %s', True)
    153153
     154    def as_dl(self):
     155        "Returns this form renderd as HTML <dt>/<dd> pairs -- excluding the <dl></dl>."
     156        return self._html_output(u'<dt>%(label)s</dt>\n<dd>%(errors)s</dd>\n<dd>%(field)s%(help_text)s</dd>', u'<dd>%s</dd>', '</dd>', u' %s', False)
     157
    154158    def non_field_errors(self):
    155159        """
    156160        Returns an ErrorList of errors that aren't associated with a particular
Back to Top