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'
Hello,
I want to use assocation proxy pattern
http://docs.sqlalchemy.org/en/latest/orm/extensions/associationproxy.html
with automap. I tried this code :
Base = automap_base()
class Dispositif(Base):
__tablename__ = 'dispositifs'
hardwares = association_proxy('disp_hardwares',
On 27.8.2015 22:13, Douglas Russell wrote:
Ok, thanks, that makes sense.
Generally everything I see about SQLAlchemy referencing is using backref and
it
is convenient, but knowing that you actually think back_populates would be
your
preferred way to implement things is quite nice. I
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):
On 8/27/15 4:41 PM, Demitri Muna wrote:
Hi,
Thanks for the help.
2015-08-27 19:03:18,095 INFO sqlalchemy.engine.base.Engine BEGIN
(implicit)
2015-08-27 19:03:18,096 INFO sqlalchemy.engine.base.Engine SELECT
platedb.plate_pointing.pk AS platedb_plate_pointing_pk,