Re: [sqlalchemy] Re: how to set assocation proxy pattern with automap

2015-08-31 Thread yoch . melka
Great thanks ! There is something I still doesn't understand with automap_base : some relationships are created only after the first query call (which takes much more time to terminate). For instance : >>> from dbaccess import *# import engine, models, etc. >>>

Re: [sqlalchemy] Re: how to set assocation proxy pattern with automap

2015-08-31 Thread Mike Bayer
On 8/31/15 3:39 PM, yoch.me...@gmail.com wrote: Great thanks ! There is something I still doesn't understand with automap_base : some relationships are created only after the first query call (which takes much more time to terminate). call configure_mappers() after you call

Re: [sqlalchemy] Re: how to set assocation proxy pattern with automap

2015-08-31 Thread yoch . melka
Thank you very much, it work fine now. Le lundi 31 août 2015 23:03:17 UTC+3, Michael Bayer a écrit : > > > > On 8/31/15 3:39 PM, yoch@gmail.com wrote: > > Great thanks ! > > > There is something I still doesn't understand with automap_base : some > relationships are created only after the

Re: [sqlalchemy] Re: how to set assocation proxy pattern with automap

2015-08-31 Thread yoch . melka
Thank you very much. Le lundi 31 août 2015 06:17:37 UTC+3, Michael Bayer a écrit : > > > > On 8/29/15 2:27 PM, yoch@gmail.com wrote: > > Thanks for the reply. > > Le vendredi 28 août 2015 18:52:37 UTC+3, Michael Bayer a écrit : > > > > On 8/28/15 3:51 AM, yoch@gmail.com wrote: > >

Re: [sqlalchemy] Re: how to set assocation proxy pattern with automap

2015-08-31 Thread Mike Bayer
On 8/31/15 8:23 AM, yoch.me...@gmail.com wrote: Thank you very much. Le lundi 31 août 2015 06:17:37 UTC+3, Michael Bayer a écrit : On 8/29/15 2:27 PM, yoch@gmail.com wrote: Thanks for the reply. Le vendredi 28 août 2015 18:52:37 UTC+3, Michael Bayer a écrit :

Re: [sqlalchemy] Re: how to set assocation proxy pattern with automap

2015-08-30 Thread Mike Bayer
On 8/29/15 2:27 PM, yoch.me...@gmail.com wrote: Thanks for the reply. Le vendredi 28 août 2015 18:52:37 UTC+3, Michael Bayer a écrit : On 8/28/15 3:51 AM, yoch@gmail.com javascript: wrote: Another question is why sqlalchemy produce two queries to get hardwares collections

Re: [sqlalchemy] Re: how to set assocation proxy pattern with automap

2015-08-29 Thread yoch . melka
Thanks for the reply. Le vendredi 28 août 2015 18:52:37 UTC+3, Michael Bayer a écrit : On 8/28/15 3:51 AM, yoch@gmail.com javascript: wrote: Another question is why sqlalchemy produce two queries to get hardwares collections from a dispositif : some_disp.hardwares 2015-08-28

[sqlalchemy] Re: how to set assocation proxy pattern with automap

2015-08-28 Thread yoch . melka
I now have a code that seems to work, but I'm not sure I did it right : Base = automap_base() class Dispositif(Base): __tablename__ = 'dispositifs' hardwares = association_proxy('disp_hdw_collection', 'hardware_ref') class Hardware(Base): __tablename__ = 'hardware'

Re: [sqlalchemy] Re: how to set assocation proxy pattern with automap

2015-08-28 Thread Mike Bayer
On 8/28/15 3:51 AM, yoch.me...@gmail.com wrote: I now have a code that seems to work, but I'm not sure I did it right : | Base=automap_base() classDispositif(Base): __tablename__ ='dispositifs' hardwares =association_proxy('disp_hdw_collection','hardware_ref') classHardware(Base):