Hi! Is there any documentation on 'cascade', 'constraints' SOCol options
(besides the source code ;)?
I've searched the main documentation and the wiki and found nothing.
As far as I can understand from the code, 'cascade' could be None (meaning
no action is done explicitely), True (meaning ON DELETE CASCADE), False
(meaning ON DELETE RESTRICT) and 'null' (meaning ON DELETE SET NULL).
you can only use it in ForeignKey columns. I see there are no constraints
set to intermediate tables of RelatedJoin, they don't even specify that
they are Foreingkeys, for example (taken from SQLO documentation):
--------------------------------------------------------
from sqlobject import *
__connection__ = 'sqlite:///:memory:'
class User(SQLObject):
username = StringCol(alternateID=True, length=20)
roles = RelatedJoin('Role')
class Role(SQLObject):
name = StringCol(alternateID=True, length=20)
users = RelatedJoin('User')
--------------------------------------------------------
Generates this SQL:
--------------------------------------------------------
CREATE TABLE role (
id INTEGER PRIMARY KEY,
name VARCHAR(20) NOT NULL UNIQUE
);
CREATE TABLE role_user (
role_id INT NOT NULL,
user_id INT NOT NULL
);
CREATE TABLE user (
id INTEGER PRIMARY KEY,
username VARCHAR(20) NOT NULL UNIQUE
);
--------------------------------------------------------
When a Role is removed, is there any way to tell SQLObject (and that he
tells to the RDBM) to remove all role_user rows that has the id of the
removed role?
OTOH, 'constraints' seems to be just some kind of validator, it doesn't
add any SQL code, is that right?
TIA.
--
LUCA - Leandro Lucarella - Usando Debian GNU/Linux Sid - GNU Generation
------------------------------------------------------------------------
E-Mail / JID: [EMAIL PROTECTED]
GPG Fingerprint: D9E1 4545 0F4B 7928 E82C 375D 4B02 0FE0 B08B 4FB2
GPG Key: gpg --keyserver pks.lugmen.org.ar --recv-keys B08B4FB2
------------------------------------------------------------------------
CARANCHO OBNUBILADO APARECE EN PARQUE CHACABUCO!
-- Crónica TV
-------------------------------------------------------------------------
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