Re: [sqlalchemy] Can't locate strategy for ... (('lazy', 'joined'),)

2015-05-21 Thread Mike Bayer
On 5/21/15 3:56 PM, Russ wrote: nope. I'd need a complete, self-contained and succinct example I can run, thanks Ok, thanks. This is a beefy one so that will be extremely tricky to extract. I had hoped that the combo of lazy+joined would have been a clear indicator since they

Re: [sqlalchemy] relationsip(): In Parent or Child Class?

2015-05-21 Thread Mike Bayer
On 5/21/15 4:32 PM, Rich Shepard wrote: There are a number of many-to-one table/class relationships in the application. In the many class I use ForeignKey() to relate that column to the appropriate 'one' class and column. Reading the ORM tutorial tells me that the relationship()

Re: [sqlalchemy] Can't locate strategy for ... (('lazy', 'joined'),)

2015-05-21 Thread Russ
Yes, 'number' is a column, as you surmised. When I drop that from the path it works fine. The only remaining problem is/was that this ends up loading in every field in the child_product table, and this includes a potentially massive BSON column (and more). After looking into this, I've now

Re: [sqlalchemy] relationsip(): In Parent or Child Class?

2015-05-21 Thread Rich Shepard
On Thu, 21 May 2015, Mike Bayer wrote: I think the best use case is to put it on both, using back_populates. This is the focus of current documentation: http://docs.sqlalchemy.org/en/rel_1_0/orm/backref.html It's more verbose but I think it's clearer and functionally this is what backref does

[sqlalchemy] relationsip(): In Parent or Child Class?

2015-05-21 Thread Rich Shepard
There are a number of many-to-one table/class relationships in the application. In the many class I use ForeignKey() to relate that column to the appropriate 'one' class and column. Reading the ORM tutorial tells me that the relationship() function can be in either table. I can specify the

Re: [sqlalchemy] relationsip(): In Parent or Child Class?

2015-05-21 Thread Rich Shepard
On Thu, 21 May 2015, Mike Bayer wrote: I think the best use case is to put it on both, using back_populates. Validation check: am I correctly using relationship() in the following set of three tables? (N.B. Other columns removed for clarity and space saving.) class Agencies(Base):

[sqlalchemy] How to use make_transient() to duplicate an SQLAlchemy mapped object?

2015-05-21 Thread c.buhtz
I opened a questions with example (pseudo) code on stackoverflow for that. http://stackoverflow.com/questions/30287042/how-to-use-make-transient-to-duplicate-an-sqlalchemy-mapped-object I know the question how to duplicate or copy a SQLAlchemy mapped object was asked a lot of times. The answer

Re: [sqlalchemy] Can't locate strategy for ... (('lazy', 'joined'),)

2015-05-21 Thread Mike Bayer
On 5/21/15 3:25 PM, Russ wrote: I have a query I am running where sqlalchemy is throwing this exception: Exception: can't locate strategy for class 'sqlalchemy.orm.properties.ColumnProperty' (('lazy', 'joined'),) What causes this is the addition of this joinedload_all option to a query

[sqlalchemy] Can't locate strategy for ... (('lazy', 'joined'),)

2015-05-21 Thread Russ
I have a query I am running where sqlalchemy is throwing this exception: Exception: can't locate strategy for class 'sqlalchemy.orm.properties.ColumnProperty' (('lazy', 'joined'),) What causes this is the addition of this joinedload_all option to a query (q): q =

Re: [sqlalchemy] Can't locate strategy for ... (('lazy', 'joined'),)

2015-05-21 Thread Russ
nope. I'd need a complete, self-contained and succinct example I can run, thanks Ok, thanks. This is a beefy one so that will be extremely tricky to extract. I had hoped that the combo of lazy+joined would have been a clear indicator since they are opposite loading strategies. Digging