Re: [SQLObject] help with circular foreign keys?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2009-05-12 08:00:27
|
On Tue, May 12, 2009 at 03:08:16AM -0400, inhahe wrote: > class Pics(SQLObject): > itemid = IntCol() > picdata = BLOBCol() > thumbnail = ForeignKey("Thumbs", cascade='null') > try: > Pics.createTable() > print "Created table Pics" > except dberrors.OperationalError: pass Why do you need these try/except? > class Thumbs(SQLObject): > itemid = IntCol() > pic = ForeignKey("Pics", cascade=True) > picdata = BLOBCol() > try: > Pics.createTable() > print "Created table Pics" > except dberrors.OperationalError: pass > > KeyError: 'No class Thumbs found in the registry http://sqlobject.org/FAQ.html#mutually-referencing-tables Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |