Friday, July 17, 2009

Foreign Key in Hidden Field

In order to have a hidden foreign key your in your form class you need to specify:
class PlanForm(forms.ModelForm):    
    owner = forms.ModelChoiceField(label="",queryset=Profile.objects.all(),widget=forms.HiddenInput())

1 comment:

Anonymous said...

I found this site using [url=][/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

Sorry for offtopic