﻿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
18185	inlineformset_factory: formfield_callback does not execute for custom fields on modelForm	kush420	nobody	"hi, 

I'm on django 1.3 using class based generic views. 

So in my use case, i have a modelForm defined with custom fields. 
something along the lines of 


{{{
class MF_B(forms.ModelForm): 
    stuff = forms.MultipleChoiceField(queryset=None, required=False) 
    class Meta: 
        model=B 

}}}

as the code above implies, I want to populate the stuff choices here 
with a queryset. 

Model B also has a foreign key to Model A such that i would call 
inlineformset_factor like so: 

{{{
AB_Formset = inlineformset_factory(A, B, form=MF_B, max_num=3, formfield_callback=self.get_field_qs)
}}}
 

Just pretend get_field_qs is in scope and what we are trying to do 
here is something like: 
http://stackoverflow.com/questions/7310861/django-passing-parameters-to-inline-formset 

My expectation here is that get_field_qs would get called for ALL 
fields on the form (i.e. including my custom fields on the 
ModelForm). 
That doesn't happen. 
Looking at the django code, if i go to 
django/forms/models.py -> def fields_for_model -> line 146 

It appears that formfield_callback will  get executed for fields on 
model ONLY. 

Because the name of the parameter is formfield_callback, I would 
expect get_field_qs would be called for all the fields. 
As a result I feel this is a bug. "	Bug	closed	Documentation	dev	Normal	wontfix	inlineformset_factory modelform formfield_callback custom fields		Design decision needed	0	0	0	0	0	0
