On Thu, Jan 8, 2009 at 3:57 PM, Zoran BoĆĄnjak <Zoran.Bosnjak@sloveniacontrol.si> wrote:
I think, this is the problem of sqlite.
Just found it in http://sqlite.org/omitted.html
Very first item says:
FOREIGN KEY constraints are parsed but are not enforced. However, the equivalent constraint enforcement can be achieved using triggers. The SQLite source tree contains source code and documentation for a C program that will read an SQLite database, analyze the foreign key constraints, and generate appropriate triggers automatically.
It is very likely that my initial classes were correct (just ForeignKey), and also the database schema is correctly created by sqlobject.

Maybe I am missing something. Your schema was OK. This is not a problem. What is IMHO not OK is inserting ID and relationship manually to the database (I mean it is not OK from the object point of view). SQLobject has to do this job behind the scene automatically and it can to it manually as you can see from my examples and from the many-to-many relationship description.