Ticket #3286: forms.py.diff

File forms.py.diff, 671 bytes (added by Jannis <jl@…>, 18 years ago)

Additional as_div method in forms.py

  • django/newforms/forms.py

     
    125125        "Returns this form rendered as HTML <p>s."
    126126        return self._html_output(u'<p>%(label)s %(field)s</p>', u'<p>%s</p>', '</p>', True)
    127127
     128    def as_div(self):
     129        "Returns this form rendered as HTML <div>s."
     130        return self._html_output(u'<div>%(label)s %(field)s</div>', u'<div>%s</div>', '</div>', True)
     131
    128132    def non_field_errors(self):
    129133        """
    130134        Returns an ErrorList of errors that aren't associated with a particular
Back to Top