[sqlalchemy] Modification tracking

2013-08-21 Thread Hans-Peter Jansen
Hi, being new to SQLAlchemy, I try to get my way through it. In an application, I have rather elaborate needs to track changes. I've defined 3 classes with declarative, where the main class has relationships with two auxiliary classes, that refer to the main class with foreign references. All

[sqlalchemy] Error 1005 (errno 150) trying to create related tables using InnoDB

2013-08-21 Thread Gerald Thibault
I have a User class, and a Registration class with a FK to User.id. When I try to create these on a db using InnoDB as default, I get this error: sqlalchemy.exc.OperationalError: (OperationalError) (1005, Can't create table 'test2.registrations' (errno: 150)) '\nCREATE TABLE

Re: [sqlalchemy] Modification tracking

2013-08-21 Thread Michael Bayer
On Aug 21, 2013, at 12:40 PM, Hans-Peter Jansen h...@urpla.net wrote: Hi, being new to SQLAlchemy, I try to get my way through it. In an application, I have rather elaborate needs to track changes. I've defined 3 classes with declarative, where the main class has relationships

Re: [sqlalchemy] Error 1005 (errno 150) trying to create related tables using InnoDB

2013-08-21 Thread Gerald Thibault
To make it sqlalchemy specific, how do i cause generated CREATE statements to use absolute schema.table names for foreign key references? I realized the reason MyISAM had no issue with it was because it ignores all those lines, so even if they were wrong (which they seem to be), it wouldn't

Re: [sqlalchemy] Error 1005 (errno 150) trying to create related tables using InnoDB

2013-08-21 Thread Michael Bayer
On Aug 21, 2013, at 5:37 PM, Gerald Thibault dieselmach...@gmail.com wrote: To make it sqlalchemy specific, how do i cause generated CREATE statements to use absolute schema.table names for foreign key references? you either need to specify schema in your referenced Table def, or you'd

[sqlalchemy] Creating Tables from a Schema defined in YAML

2013-08-21 Thread monosij . forums
Hello - Wondering if someone could please help me with this: I have created a schema definition file in YAML which I read into a dict. I am used to statically creating a table in this form: tableName = Table (theTableName, Metadata, Column(column1, String), Column(column2, String),