On Tue, Nov 07, 2006 at 09:05:52PM -0200, Jorge Godoy wrote:
> Oleg Broytmann <[EMAIL PROTECTED]> writes:
> > class Country(SQLObject):
> >     title = UnicodeCol()
> >     town = ForeignKey('Town', cascade=True)
> >
> >    "cascade" is implemented in the 0.7 brnach for SQLite, Postgres, Sybase,
> > MSSQL and MaxDB; in the 0.8 branch also for MySQL.
> 
> Shouldn't it be "False"?  I believe that True will cascade the deletion and
> when removing the Town it will remove the Country as well.  Setting it to
> False should prevent the deletion of any used Towns. 

   Yes, you are right:

        if self.cascade is not None:
            if self.cascade == 'null':
                action = 'ON DELETE SET NULL'
            elif self.cascade:
                action = 'ON DELETE CASCADE'
            else:
                action = 'ON DELETE RESTRICT'

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to