Re: [SQLObject] How do I update a many-to-many field?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ma...> - 2005-12-24 09:52:32
|
On Fri, Dec 23, 2005 at 10:23:52PM +0000, Mike Kent wrote: > author = Author("Geissel") > book.addAuthor(author) > > No, that's not right. I just gave that book two authors. Yes, you did, and that's right. This is exactly what you did (not what you meant). > What I want is some kind of update that will properly handle the deletion of the > previous author and addition of the new author to the magic book-to-author table Do you want to replace the author? Than you don't want many-to-many relationship. > Or at least a way for me to delete the previous > author entries for this book book.removeAuthor(author) author.removeBook(book) Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |