﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23236	forms.Form should support a Meta class like forms.ModelForm	django@…	nobody	"Please feel free to close this if you think my use case is too specific.

My use case is that I'd like to edit the `widgets` of a subclassed form.Form, the only way I can currently do this is by overriding the entire field or by overriding `__init__()`

Example:



{{{
class MyAuthenticationForm(django.contrib.auth.forms.AuthenticationForm):
    class Meta:
        wigets = {
            'username' : MyFancyWidget()
        }
}}}



Right now, I have to do something like (which isn't especially DRY):


{{{
class MyAuthenticationForm(django.contrib.auth.forms.AuthenticationForm):
    def __init__(self, *args, **kwargs):
        super(MyAuthenticationForm, self).__init__(self, *args, **kwargs)
        self.fields['username'].widget = MyFancyWidget()
}}}


I argue that a form's `Meta` class will be a familiar concept to most django developers (as `ModelForms` are commonly used), and so extending to `forms.Form` would be natural.

Of course, if `Meta` were used for plain old `forms.Form`, then you could also use it as a means to exclude fields in the parent form (e.g. in this case you could do something like


{{{
class Meta:
    exclude = ('password',)
}}}


(not that that would be any use in this case)"	New feature	closed	Forms	dev	Normal	wontfix			Unreviewed	0	0	0	0	0	0
