For the sake of argument, I have two models:  Book and Author.  Book
has many fields and has a foreign key relationship with Author.
Author has two fields and no additional relationships.  To stay DRY, I
have BookForm and AuthorForm classes that I use to generate the HTML
for each class.

When I save, I do the following:

>> author = AuthorForm(request.POST).save()

This gives me the Author object for the author that was just inserted
into the DB.  Now I'd like to insert Book into the database, however,
I need to include Author due to the FK relationship.  As such...

>> book = BookForm(request.POST).save()

...won't work.  How can I go about inserting the book record once I
have the author record?


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