Re: [sqlalchemy] Re: Generic Associations - table_per_association: parent attribute

2018-07-30 Thread Mike Bayer
the discriminator_on_association example http://docs.sqlalchemy.org/en/latest/_modules/examples/generic_associations/discriminator_on_association.html illustrates how to have a .parent link. On Mon, Jul 30, 2018 at 5:48 AM, Simon King wrote: > You could build this, but it's going to be messy. At

Re: [sqlalchemy] Re: Generic Associations - table_per_association: parent attribute

2018-07-30 Thread Simon King
You could build this, but it's going to be messy. At the SQL level, if you look at an Address row, there's not enough information to know which association table to look in. You'd have to query all of the association tables (perhaps using a UNION) to find the one that contains the parent, and then

[sqlalchemy] Re: Generic Associations - table_per_association: parent attribute

2018-07-28 Thread Sven
Hi Mike, Ok, let's forget everything I said before, it is too confusing. I propose to start from the *table_per_association* example: http://docs.sqlalchemy.org/en/latest/_modules/examples/generic_associations/table_per_association.html Would it be possible to have an attribute

Re: [sqlalchemy] Re: Generic Associations - table_per_association: parent attribute

2018-06-24 Thread Mike Bayer
I think noone is responding to this because the request is extremely vague. I have no idea what "stored by hands" means nor what a Hands / ObjectContainers is. To get help with an issue you need to share extremely specific information including the table schemas you are using (as SQLAlchemy

[sqlalchemy] Re: Generic Associations - table_per_association: parent attribute

2018-06-24 Thread Sven
Hello, Any idea regarding my problems ? Thank you ! Sven -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a

[sqlalchemy] Re: Generic Associations - table_per_association: parent attribute

2018-06-10 Thread Sven
Hello, has sometone an answer or an idea which I can study ? I also tried the table_per_related example but It will not works since my "Object" instances have to be able to be stored by hands and by ObjectContainers and to be able to go from Hands to ObjectContainers (and vice versa). Indeed,