hello. i'm testing next level of complexity - 3 level inheritance. C inherits B inherits A, all via table-inheritance, no relations. A,B are with polymorphic mappers via unions. e.g. A=Employee, B=Engineer, C=Manager.
The problem is: i cannot query the base polymorphic mapper A.
querying B and C is ok (as well as any other levels above, and/or
non-polymorphic mappers on all levels).
The error is:
sqlalchemy.exceptions.NoSuchColumnError:
"Could not locate column in row for column 'pu_Engineer.atype'
(Engineer is level B in this case.)
-----------
Also, we've noticed (well, postgres did it), that the most internal
select (for that same B-level) of the polymorphic_union has 2 "xxx.id
AS id" columns:
SELECT "pu_Engineer".machine AS
pu_Engineer_machine, "pu_Engineer".atype AS
pu_Engineer_atype, "pu_Engineer".name AS pu_Engineer_name,
pu_Engineer.duties AS "pu_Engineer_duties", "pu_Engineer".id AS
pu_Engineer_id
FROM (
SELECT "Engineer".machine AS machine,
"Employee".atype AS atype, "Employee".name AS name,
"Manager".duties AS duties, "Manager".id AS id
FROM "Employee" JOIN "Engineer" ON "Employee".id = "Engineer".id
JOIN "Manager" ON "Engineer".id = "Manager".id
UNION ALL
SELECT anon.machine AS machine, anon.atype AS atype, anon.name AS
name, CAST(NULL AS TEXT) AS duties, anon.id AS id
FROM (
SELECT "Employee".name AS name, "Employee".id AS
id, "Employee".atype AS atype,
"Engineer".machine AS machine, "Engineer".id AS id
FROM "Employee" JOIN "Engineer" ON "Employee".id = "Engineer".id
WHERE "Employee".atype = ?
) AS anon
) AS "pu_Engineer" ORDER BY "pu_Engineer".oid
-------------
see/run attached file
ciao
svil
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---
sa_ABC_inh1.py
Description: application/python
