Oleg Broytmann a écrit :
I didn't know about this nice feature!
On Tue, Nov 07, 2006 at 09:05:52PM -0200, Jorge Godoy wrote:
Oleg Broytmann <firstname.lastname@example.org> writes:
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'
action = 'ON DELETE CASCADE'
action = 'ON DELETE RESTRICT'
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?