[sqlalchemy] column_descriptions on recursive query : AttributeError: 'CTE' object has no attribute 'entity'

2015-04-29 Thread g
Hi all I have a query like that from sqlalchemy.orm import aliased class Part(Base): __tablename__ = 'part' part = Column(String, primary_key=True) sub_part = Column(String, primary_key=True) quantity = Column(Integer) included_parts = session.query(

[sqlalchemy] Re: How to view (get actual print-out) of the contents of db tables?

2015-04-29 Thread Jonathan Rogers
On Tuesday, April 28, 2015 at 3:42:40 PM UTC-4, Ivan Evstegneev wrote: Greetings everyone!!! I have a little question. Is there some way (tool) to print the contents of the tables in sqlalchemy? The most straightforward way to see the contents of a table in any SQL database is to

Re: [sqlalchemy] Why is an association object mark as dirty instead of deleted when removed?

2015-04-29 Thread Mike Bayer
On 4/29/15 12:11 PM, st...@canary.md wrote: Since my association object doesn't have extra columns, the row ('bob, 'apple') will be deleted. However, if there are extra columns, then having it marked as dirty is desired. Perhaps I would delay my recording of my audit rows until after

Re: [sqlalchemy] SA 1.0.2 throwing TypeError: Boolean value of this clause is not defined

2015-04-29 Thread Mike Bayer
On 4/29/15 11:00 AM, Bill Schindler wrote: Here's the contents of session.dirty just prior to the commit. It looks like what I expected, with no unexpected additional objects. Is there anything in there that looks like it could cause the exception? session.dirty = IdentitySet([

Re: [sqlalchemy] Why is an association object mark as dirty instead of deleted when removed?

2015-04-29 Thread steve
Since my association object doesn't have extra columns, the row ('bob, 'apple') will be deleted. However, if there are extra columns, then having it marked as dirty is desired. Perhaps I would delay my recording of my audit rows until after orphans are resolved. I am already using after_flush,

Re: [sqlalchemy] SA 1.0.2 throwing TypeError: Boolean value of this clause is not defined

2015-04-29 Thread Mike Bayer
On 4/29/15 2:09 PM, Bill Schindler wrote: Not sure if your patch also handles the case when there's no boolean, but I'm also getting the exception with this in session.dirty: IdentitySet([UserLoginTracking(id=37, userid='bills', lastseen=datetime.datetime(2015, 4, 29, 12, 57, 52, 648042,

Re: [sqlalchemy] SA 1.0.2 throwing TypeError: Boolean value of this clause is not defined

2015-04-29 Thread Mike Bayer
On 4/29/15 2:09 PM, Bill Schindler wrote: Not sure if your patch also handles the case when there's no boolean, but I'm also getting the exception with this in session.dirty: IdentitySet([UserLoginTracking(id=37, userid='bills', lastseen=datetime.datetime(2015, 4, 29, 12, 57, 52, 648042,

Re: [sqlalchemy] SA 1.0.2 throwing TypeError: Boolean value of this clause is not defined

2015-04-29 Thread Bill Schindler
Not sure if your patch also handles the case when there's no boolean, but I'm also getting the exception with this in session.dirty: IdentitySet([UserLoginTracking(id=37, userid='bills', lastseen=datetime.datetime(2015, 4, 29, 12, 57, 52, 648042,

[sqlalchemy] prototyping a complex query?

2015-04-29 Thread Jonathan Vanasco
I have a rather complex query that I've written in SQL • The result-set is 6 columns (1 = timestamp, 2-6 = fkeys on tables/objects) • The query involves 15 tables • The query is about 100 lines of raw SQL • The query is not fun, and apt to change • There are 2 placeholders/bind variables to be

Re: [sqlalchemy] SA 1.0.2 throwing TypeError: Boolean value of this clause is not defined

2015-04-29 Thread Bill Schindler
No, no PickleTypes. And my manual testing shouldn't have any other objects in session.dirty -- but I'll double-check that. The two classes with a custom comparator (which uses == in any case) is never seen by this module -- and they're never updated by any code in this server. There's a

Re: [sqlalchemy] SA 1.0.2 throwing TypeError: Boolean value of this clause is not defined

2015-04-29 Thread Mike Bayer
On 4/29/15 9:25 AM, Bill Schindler wrote: This error is being thrown on code that worked with 0.9.8. It seems to be checking a comparison on something, but I can't figure out which this clause the exception is referring to. Here's the stripped-down code leading up to the commit:

[sqlalchemy] SA 1.0.2 throwing TypeError: Boolean value of this clause is not defined

2015-04-29 Thread Bill Schindler
This error is being thrown on code that worked with 0.9.8. It seems to be checking a comparison on something, but I can't figure out which this clause the exception is referring to. Here's the stripped-down code leading up to the commit: ancient = utcnow() - timedelta(hours=8)

Re: [sqlalchemy] column_descriptions on recursive query : AttributeError: 'CTE' object has no attribute 'entity'

2015-04-29 Thread Mike Bayer
On 4/29/15 5:16 AM, g wrote: Hi all I have a query like that from sqlalchemy.orm import aliased class Part(Base): __tablename__ = 'part' part = Column(String, primary_key=True) sub_part = Column(String, primary_key=True) quantity = Column(Integer)

Re: [sqlalchemy] SA 1.0.2 throwing TypeError: Boolean value of this clause is not defined

2015-04-29 Thread Bill Schindler
Here's the contents of session.dirty just prior to the commit. It looks like what I expected, with no unexpected additional objects. Is there anything in there that looks like it could cause the exception? session.dirty = IdentitySet([ LiveSession(id=49, prodid=u'folio',