yeah, i know. sorry for the late question, i think i was a bit too tired to continue coding. anyway, i circumvented the problem by using a select using A.__table__, which works for what I need (i have a heavily modified hierarchical extension based on Mariano Mara's code (https://pypi.python.org/pypi/sqla-hierarchy)). when it comes to polymorphism, i forgot that i had to use select instead of query to retrieve my objects :)

best regards,
richard.

On 04/27/2015 07:41 PM, Mike Bayer wrote:


On 4/27/15 4:31 PM, Richard Gerd Kuesters wrote:
well, i'm having trouble dealing with polymorphic objects. i mean, the functionality is fine, i just don't know how to obtain the "main" object.

let me be clear: i have A, which is my main object, and is inherited by B and C. I would like to work with the A object, even though it's polymorphic identity refers to B or C. I know it's not the default behavior, but can I obtain A from a query?

perhaps you could be more specific.

If a query returns B and C objects, if those inherit from A, they *are* A objects.




thanks a lot!
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 <mailto:sqlalchemy+unsubscr...@googlegroups.com>. To post to this group, send email to sqlalchemy@googlegroups.com <mailto:sqlalchemy@googlegroups.com>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
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 <mailto:sqlalchemy+unsubscr...@googlegroups.com>. To post to this group, send email to sqlalchemy@googlegroups.com <mailto:sqlalchemy@googlegroups.com>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
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.
For more options, visit https://groups.google.com/d/optout.

<<attachment: richard.vcf>>

Reply via email to