Re: Form hidden filed for foreign key - validation error
On Tue, May 3, 2011 at 11:16 PM, Boris Tomic <nori.kodmasin@gmail.com> wrote:
> I have added (required=False) to field:
>> contactid = ModelChoiceField(queryset=Contact.objects.all(),
>> widget=HiddenInput())
>>
>
> so now I have:
> contactid = ModelChoiceField(queryset=Contact.objects.all(),
> widget=HiddenInput(), required=False)
>
> and it seems to be working. To me this looks as bug but maybe it is
> feature.
>
More likely is that you were not outputting the hidden field, and so
the form fails to validate. Making the field not required only hides
the issue.
Cheers
Tom
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home