WOW, I hadn't seen that first one, and the second one is the 'standard' for
most newforms replies, great work!

Thanks again Michael.

John

On 5/16/07, Michael Trier <[EMAIL PROTECTED]> wrote:
>
>
> These two posts gave me everything I needed to tackle these type of
> issues:
>
> http://weblog.bignerdranch.com/?p=31
>
> http://code.pui.ch/2007/01/07/using-djangos-newforms/
>
> Michael
>
> On 5/16/07, James Bennett <[EMAIL PROTECTED]> wrote:
> >
> > 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 [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