Oleg Broytmann a écrit :
> 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.
>   
I didn't know about this nice feature!
It would be nice to update the main documentation. It seems that it is
documented only in the change log (since 0.6...)

For mysql support, is there a 0.8 pre release panned? What is the state
of the trunk?

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to