﻿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
13918	[patch] Simplify implementation of `get_model_and_form_class`	Satoru Logic	Satoru Logic	"In `django.views.generic.create_update.get_model_and_form_class`, a form_class is constructed this way
{{{
        # The inner Meta class fails if model = model is used for some reason.
        tmp_model = model
        # TODO: we should be able to construct a ModelForm without creating
        # and passing in a temporary inner class.
        class Meta:
            model = tmp_model
        class_name = model.__name__ + 'Form'
        form_class = ModelFormMetaclass(class_name, (ModelForm,), {'Meta': Meta})
}}}

When I looked into the `django.forms.models` module I found a function called `modelform_factory` that can make this much simpler:
{{{
form_class = modelform_factory(model)
}}}"		closed	Generic views	1.2		fixed		liaoxuecong@…	Accepted	1	0	0	0	0	0
