﻿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
9150	Generic views should accept arguements for form_class	ErikW	Thomas Bechtold	"The form_class property for generic views such a django.views.generic.create_update.* should accept either a ModelForm class or a ModelForm object.  This would allow generic ""wrapper views"" to easily inject run-time data into the form instance.

This will be useful for sites which use contrib.auth to create ""members only"" area.  Such sites would be able to use generic views while restricting the view's queryset to the currently logged in user.  It would also make it easier for the create_object generic view to set the ""user ForeignKey"" to the currently logged in user behind the scenes.  Right now, request.POST has to be manipulated in a wrapper view to hide this field from the end-user.

If form_class would accept ModelForm(initial={'user': request.user,}) instead of just ModelForm, this problem would be eased.  Alternatively, maybe generic views could accept another property containing a dictionary of desired arguments to feed to the ModelForm object.

I think this or a similar enhancement would greatly expand the situations where generics can be used."		closed	Generic views	dev		fixed	generic views, form_class, arguments	Aaron C. de Bruyn	Design decision needed	1	0	1	0	0	0
