This question was asked here: [Django: Reuse form fields without inheriting?](https://stackoverflow.com/questions/5184503/django-reuse-form-fields-without-inheriting)

Although, accepted answer is clear, but it is not very handy, if I want to override many form methods.

Most voted answer is somewhat more difficult and moreover doesn't work.

So, what is the clear and pythonic way to include same fields into multiple forms (either forms or ModelForms) with or without inheriting?

For example, I want following class to be reusable.

```
class SetPasswordMixin(forms.Form):

password1 = forms.CharField(label=_('Password'), widget=forms.PasswordInput(attrs={'placeholder': _('Password')}))
password2 = forms.CharField(label=_('Password confirmation'),
                            widget=forms.PasswordInput(attrs={'placeholder': _('Password confirmation')}))

def clean_password2(self):
    # Check that the two password entries match
    password1 = self.cleaned_data.get("password1")
    password2 = self.cleaned_data.get("password2")
    if password1 and password2 and password1 != password2:
        raise forms.ValidationError(_("Passwords don't match"))
    return password2

```