Ticket #4384: empty_form.diff

File empty_form.diff, 600 bytes (added by sime <simon@…>, 17 years ago)

provides forms.new_form()

  • django/newforms/forms.py

     
    1212from widgets import TextInput, Textarea
    1313from util import flatatt, ErrorDict, ErrorList, ValidationError
    1414
    15 __all__ = ('BaseForm', 'Form')
     15__all__ = ('BaseForm', 'Form', 'empty_form')
    1616
    1717NON_FIELD_ERRORS = '__all__'
    1818
     
    319319            return self.html_name
    320320        return ''
    321321    auto_id = property(_auto_id)
     322
     323def empty_form():
     324    return type('EmptyForm', (Form,), {})
Back to Top