On 5/16/07, John M <[EMAIL PROTECTED]> wrote:
> Thanks for info, but what happens when the form.save() is called,
> since the FK isn't part of the clean_data, it will fail no?

Form.save accepts a 'commit' keyword argument, which default to True;
when it's True the form will try to actually save to the database, and
when it's False it won't. So if you know that you don't yet have
enough data to correctly save to the DB, you can do:

new_obj = form.save(commit=False)
#...do more stuff with the object before saving to the DB

Either way, 'save()' will return the object, but passing commit=False
will tell it you're not ready to hit the DB just yet.


-- 
"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 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