see ticket #3257

it is complete patch with tests, the only thing missing is a decision
whether (and potentially how) to add ( "", "-----" ) to choices
magically if required is False

On 1/24/07, ak <[EMAIL PROTECTED]> wrote:
>
> Adrian, is there any progress on correct handling of foreign key fields
> in newforms ? Or could you please give any timeline when this might be
> expected to be done ? Even up-to-date svn gives the same error when
> trying to save a form with foreign key field.
>
> Also, whould it be possible to do something like:
> PaymentForm = forms.models.form_for_model(Payment)
> del PaymentForm.fields['user'] # we need to hide foreign key User
> (customer) in html form, its stored in session
> .....
> if form.is_valid():
>     form.clean_data['user'] = user # or user.id
>     form.save()
>
> so we don't show select field for User, but then we force form to
> predefined user value
>
>
> >
>


-- 
Honza Kr�l
E-Mail: [EMAIL PROTECTED]
ICQ#:   107471613
Phone:  +420 606 678585

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to