﻿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
16701	FormMixin.initial is shared between all child classes	wilfred@…	nobody	"FormMixin in django/views/generic.py has an `initial` class variable. This is bad because it is shared between classes. If I do the following:

{{{
class MyUpdateView(BaseUpdateView, TemplateView):
    form_class = ArtworkForm
    template_name = 'admin/admin__artwork_create_or_update.html'

    def get_initial(self):
        initial = super(MyUpdateView, self).get_initial()

        initial['level'] = self.artwork.level
        initial['artist'] = self.artwork.artist

        return initial

}}}

this causes me problems because I also have a create view:

{{{
class MyCreateView(BaseCreateView, TemplateView):
    template_name = 'admin/admin__artwork_create_or_update.html'
    form_class = ArtworkForm

}}}

and this create view ends up with the initial values I only want for updating. It would be much better if this were an instance attribute. Patch attached, I hope it's OK."	Bug	closed	Generic views	1.3	Normal	duplicate			Unreviewed	1	0	0	0	0	0
