﻿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
17161	Call super in BaseForm.__init__	reames@…	nobody	"Currently /django/forms/forms.py !BaseForm.!__init!__ (as well as a fair number of other classes) does not call super().!__init!__. This makes it impossible to create form mixins. 
Consider:

{{{
from django import forms

class FormMixin(object):
  def __init__(self, *args, **kwargs):
    super(FormMixin, self).__init__(*args, **kwargs)
    self.my_flag = true

class MyForm(forms.Form, FormMixin):
  field1 = forms.CharField()

class MyModelForm(forms.ModelForm, FormMixin):
  class Meta(object):
    model = SpamModel

}}}

Because of python's mro the init() in the mixin never gets called because !BaseForm.!__init!__ does not call it. 

Ideally, all classes in django that have an !__init!__() should also call super().!__init!__()"	Bug	closed	Forms	1.3	Normal	invalid			Unreviewed	0	0	0	0	0	0
