﻿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
14797	ModelFormMixin's get_form_class() logic broken; fails with custom get_queryset() method	Gabriel Grant	Gabriel Grant	"In the ModelFormMixin's get_form_class(), the logic in the else clause is broken:

- if self.model is set, it uses that instead of the queryset (whereas according to [http://docs.djangoproject.com/en/dev/ref/class-based-views/#django.views.generic.detail.SingleObjectMixin.queryset the docs] ""the value of SingleObjectMixin.queryset supersedes the value provided for SingleObjectMixin.model"")
- if self.model is not set, it uses self.queryset.model, ignoring the get_queryset() method

The attached patch fixes both issues

As an aside, perhaps SingleObjectMixin should have a get_model() method that encapsulates and/or shortcuts this logic? On the one hand, using get_queryset().model isn't particularly intuitive, but on the other hand having get_model() may be getting a little too fine-grained."		closed	Generic views	dev		fixed			Unreviewed	1	0	0	0	0	0
