﻿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
7541	newforms-admin: doesn't respect overridden querysets in formfields	lukas@…	Brian Rosner	"Given this code:
{{{
class AdminPersonForm(forms.ModelForm):
    class Meta:
        model = Person
    
    def __init__(self, *args, **kwargs):
        super(AdminPersonForm, self).__init__(*args, **kwargs)
        self.fields[""my_fk_field""].queryset = SomeModel.objects.filter(obj=self.instance)

class PersonAdmin(admin.ModelAdmin):
    form = AdminPersonForm
}}}
one would expect the dropdown list for my_fk_field in the admin to be limited to the assigned queryset. This is not the case in newforms-admin as of today - the resulting dropdown contains the unfiltered all()-queryset.

Brosner said in irc it might have something to do with RelatedFieldWidgetWrapper in django.contrib.admin.widgets."		closed	contrib.admin	newforms-admin		fixed	nfa-blocker		Fixed on a branch	0	0	0	0	0	0
