[sqlalchemy] Re: sqlalchemy orm doesn't create an instance of certain rows

2007-03-28 Thread Michael Bayer
the issue is that the built-in relationship joining facilities dont know how to generate joins for self-referential relationships that you could then reference externally in your criterion. while its easy enough for the join to add in an alias there, all subsequent operations on the query

[sqlalchemy] Re: sqlalchemy orm doesn't create an instance of certain rows

2007-03-26 Thread Michael Bayer
i notice that neither your table DDL nor your mappers have any notion of a primary key, so thats not the complete application...whats below will throw an error immediately. but the most likely cause for what youre seeing is that if any element of the primary key in a result row is None, no

[sqlalchemy] Re: sqlalchemy orm doesn't create an instance of certain rows

2007-03-26 Thread Karthik Krishnamurthy
It works after I specify primary_key in my mapper or allow_null_pks, but not if I specify the column as primary_key in the Table() constructor. Thanks /kk On 3/26/07, Michael Bayer [EMAIL PROTECTED] wrote: i notice that neither your table DDL nor your mappers have any notion of a primary

[sqlalchemy] Re: sqlalchemy orm doesn't create an instance of certain rows

2007-03-26 Thread Karthik Krishnamurthy
Another issue with the same setup: node = query.select_by(name='konsole19.xx..com')[0] print query.select_by(console=node) The debugging output shows this: INFO:sqlalchemy.engine.base.Engine.0x..74:SELECT node.cport AS node_cport, node.type_id AS node_type_id, node.locshelf AS