Hi all,
I've been playing with "sqla_hierarchy" from
https://github.com/marplatense/sqla_hierarchy .
The problem is: the returned query appends 3 columns: level (Integer),
is_leaf (Boolean) and connect_path (pg ARRAY).
So far, so good. If I execute the query using
"session.execute(q).fetchall()", it works like a charm. But, as we know,
"session.execute" returns a RowProxy, not objects. Using
"session.query(MyObj).from_statement(q).all()", I'm able to get my
mapped objects, but without the extra columns that would make me very
pleased (level, is_leaf, connect_path). Is there a way to get around this?
I have done testings using "o = type('MyObjExt', (MyObj,), {'__table__':
q}" and them use it on the session.query, *but* it looses foreign key
references - or, well, I don't know how to "explain" this to the mapper
(?), since MyObj is polymorphic (probably the pitfall?).
Thanks for your time and help.
Best regards,
Richard.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.