Briefly, I have a situation in which a mapper works fine unless I
change loading to lazy=False on one of the relationships.

The mapper is:

mapper(Item, item_table, properties = dict(keywords = relation(Keyword,
secondary=itemkeyword_table, lazy=False, backref='items'),
display_keywords = relation(Keyword,
primaryjoin=and_(keyword_table.c.uuid==itemkeyword_table.c.keyword_uuid,
item_table.c.uuid==itemkeyword_table.c.item_uuid,
itemkeyword_table.c.display==True),
viewonly=True, foreignkey=keyword_table.c.uuid, lazy=False),))

It is the display_keywords relationship that is the problem, without
lazy=False, it works fine and with it I get the following exception:

sqlalchemy.exceptions.SQLError: (OperationalError) no such column:
item_keyword.display 'SELECT item.note AS item_note, item.uuid AS
item_uuid, item.deleted AS item_deleted, item.section_id AS
item_section_id, item.createdate AS item_createdate, keyword_6166.uuid
AS keyword_6166_uuid, keyword_6166.deleted AS keyword_6166_deleted,
keyword_6166.timestamp AS keyword_6166_timestamp, keyword_6166.name AS
keyword_6166_name, item.duedate AS item_duedate, item.priority AS
item_priority, item.finisheddate AS item_finisheddate, item.timestamp
AS item_timestamp, keyword_2ff3.uuid AS keyword_2ff3_uuid,
keyword_2ff3.deleted AS keyword_2ff3_deleted, keyword_2ff3.timestamp AS
keyword_2ff3_timestamp, keyword_2ff3.name AS keyword_2ff3_name, item.id
AS item_id, item.name AS item_name \nFROM item LEFT OUTER JOIN keyword
AS keyword_6166 ON keyword_6166.uuid = item_keyword.keyword_uuid AND
item.uuid = item_keyword.ite
m_uuid AND item_keyword.display = ? LEFT OUTER JOIN item_keyword AS
item_keyword_2d36 ON item.uuid = item_keyword_2d36.item_uuid LEFT OUTER
JOIN keyword AS keyword_2ff3 ON keyword_2f
f3.uuid = item_keyword_2d36.keyword_uuid ORDER BY item.oid,
keyword_6166.oid, item_keyword_2d36.oid' [1]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sqlalchemy
-~----------~----~----~----~------~----~------~--~---

Reply via email to