﻿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
15303	Clarify View.as_view() docs in respect to functions passed as kwargs.	Gabriel Grant	nobody	"Problem:

At the moment, generic.base.View.as_view() passes kwargs to the class' init (which `setattr`s them), rather than dynamically subclassing. The [http://docs.djangoproject.com/en/dev//topics/class-based-views/ introductory generic view docs], however, seem to imply that passing kwargs to the as_view() method is equivalent to overriding the class. For example, it [http://docs.djangoproject.com/en/dev//topics/class-based-views/#simple-usage refers to] ""pass[ing] the new attributes into the as_view method call"" as an ""overriding pattern."" This makes it rather surprising that functions passed to as_view() aren't bound to the resultant instance.

Possible Resolutions:

It seems to me that as_view() should dynamically create a subclass with the provided kwargs. Alternatively, if that is deemed undesirable, the docs should at least be clarified to better explain the true behaviour.

I can provide a patch, but need someone (*cough* RKM :) to confirm the desired behaviour."	Cleanup/optimization	closed	Documentation	dev	Normal	needsinfo			Accepted	0	0	0	0	0	0
