Ticket #4384: new_form.diff

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

oops I renamed it, think I like the new_form name slightly better

  • 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', 'new_form')
    1616
    1717NON_FIELD_ERRORS = '__all__'
    1818
     
    319319            return self.html_name
    320320        return ''
    321321    auto_id = property(_auto_id)
     322
     323def new_form(klass=Form):
     324    return type('New%s' % klass.__name__, (klass,), {})
Back to Top