Re: [sqlalchemy] best ways to preserve and analyze detached/unbound items

2018-05-01 Thread Jonathan Vanasco
Thanks for all this help, Mike! On Tuesday, May 1, 2018 at 8:56:35 PM UTC-4, Mike Bayer wrote: > > at what "moment in time"?I thought you might mean when they are > expired from the Session, easy enough use the expire event > > http://docs.sqlalchemy.org/en/latest/orm/events.html?highlight=e

Re: [sqlalchemy] Preserving association record when using select_from?

2018-05-01 Thread Mike Bayer
On Tue, May 1, 2018 at 4:34 PM, Gerald Thibault wrote: > I will start by noting that we are using an api framework in which all > operations (view, create, delete, etc) are done on a primary object, > specified in the configuartion of each resource, this is important because > it prevents "the eas

Re: [sqlalchemy] best ways to preserve and analyze detached/unbound items

2018-05-01 Thread Mike Bayer
On Tue, May 1, 2018 at 2:13 PM, Jonathan Vanasco wrote: > I have a debugging toolbar on a web panel that occasionally receives > SqlAlchemy objects, which are unbound/detached by their nature. > > Is there a way I can preserve their contents as a dict (at that moment in > time) which can be iterat

[sqlalchemy] Preserving association record when using select_from?

2018-05-01 Thread Gerald Thibault
I will start by noting that we are using an api framework in which all operations (view, create, delete, etc) are done on a primary object, specified in the configuartion of each resource, this is important because it prevents "the easy way" of getting the results i want, so I am looking for an

[sqlalchemy] best ways to preserve and analyze detached/unbound items

2018-05-01 Thread Jonathan Vanasco
I have a debugging toolbar on a web panel that occasionally receives SqlAlchemy objects, which are unbound/detached by their nature. Is there a way I can preserve their contents as a dict (at that moment in time) which can be iterated/inspected? Looking at `ormInstance.__dict__['_sa_instance_st

Re: [sqlalchemy] SQL Alchemy versus psycopg2

2018-05-01 Thread Mike Bayer
Can't help but make the comment that ORMs can work with CTEs and you can write them semantically the same as you'd do in straight SQL, as well as that they are capable of working with database schemas that are already designed. Does your program emit SELECT statements (perhaps against views) and

Re: [sqlalchemy] Confused about Many-to-Many outerjoin

2018-05-01 Thread Simon King
On Tue, May 1, 2018 at 2:35 PM, wrote: > I'm using the PrettyPrinted tutorial on Many to Many relationships with > Flask-SQLAlchemy however what I'm trying to figure out he doesn't go into in > the tutorial and I haven't had much luck in _Essential SQLAlchemy_ or > StackOverflow finding a solutio

[sqlalchemy] Confused about Many-to-Many outerjoin

2018-05-01 Thread chbrnola
I'm using the PrettyPrinted tutorial on Many to Many relationships with Flask-SQLAlchemy however what I'm trying to figure out he doesn't go into in the tutorial and I haven't had much luck in _Essential SQLAlchemy_ or StackOverflow finding a solution. So for his example he has two main tables,

[sqlalchemy] SQL Alchemy versus psycopg2

2018-05-01 Thread Tony S
Just looking for some input as I am in the beginning process of moving an application from an MS base using SQL Server, SSRS and SSIS over to Postgres / Python (for now). I am not looking at using the ORM for various reasons: - Python will not be the only language or tool accessing and updat