[Chicago] SQLAlchemy presentation
Massimo Di Pierro
mdipierro at cs.depaul.edu
Fri Sep 11 07:32:04 CEST 2009
Hi Daniel,
thank you for your SQLAlchemy presentation. It was inspiring. In fact,
I did not know SQLAlchemy could handle "on delete cascade" with sqlite.
This is an important feature that web2py (currently) does not have. So
I have now implemented this feature in web2py and it is in trunk.
Here is an example:
python web2py.py -S welcome -M
>>> db.define_table('a', Field('name'))
>>> db.define_table('b', Field('name'),
Field('a',db.a,ondelete='CASCADE'))
>>> ida = db.a.insert(name='xxx')
>>> db.b.insert(name='yyy', a=ida)
1
>>> db(db.a.id == ida).delete()
1
More information about the Chicago
mailing list