On Jan 26, 2008 11:36 PM, msoulier <[EMAIL PROTECTED]> wrote:
> instance = models.ForeignKey(TugInstance)
>
> When my form is submitted, I am assigning
>
> client.instance = form.clean_data['instance_id']

You can assign a numeric ID of a TugInstance object to 'instance_id'
on a Client object.

You can assign an actual honest-to-goodness TugInstance object to
'instance' on a Client object.

Both of these will save properly.

You cannot assign an actual honest-to-goodness TugInstance object to
'instance_id' on a Client object.

You cannot assign a numeric ID of a TugInstance object to 'instance'
on a CLient object.

Both of these will fail to save.

In other words, the actual field you set up wants an actual model
instance, while the hidden '_id' which backs it wants a numeric ID.



-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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