On Wed, Oct 10, 2007 at 03:41:22PM +0200, [EMAIL PROTECTED] wrote:
> I'd like to delete Multiple objects at once by deleting their parent
> object. I'd expect the DB's cascade mechanics to handle the details for me,
> but, as it seems, SQLObject deletes related objects BEFORE passing the
> delete command of the parent object to the DB.
>
> An Example:
>
> class AB(sqlobject.SQLObject):
> a = sqlobject.ForeignKey('A', cascade = True)
> b = sqlobject.ForeignKey('B', cascade = True)
>
> class A(sqlobject.SQLObject):
> b = sqlobject.RelatedJoin('B', intermediateTable = AB.sqlmeta.table,
> createRelatedTable = False)
>
> class B(sqlobject.SQLObject):
> a = sqlobject.RelatedJoin('A', intermediateTable = AB.sqlmeta.table,
> createRelatedTable = False)
In case of RelatedJoins SQLObject deletes objects from the intermediate
table itself because the table can be hidden from the user at all - it is
usually automatically created and maintained.
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss