I've been banging on this for hours, but I seem to be getting nowhere.
I've tried more things that I can count, but here are two of my attempts:
# result = (
# Pipeline.query
# .select_from(Storage, NewProduct)
# .join(Storage, pipeline_alias1.storage_id == Storage.id)
# .join(NewProduct, Storage.product_id == NewProduct.id)
# .filter(pipeline_alias2.storage_id ==
storage_alias1.id)
# .filter(storage_alias2.product_id ==
product_alias1.id)
# )
result = (
Pipeline.query
.select_from(Pipeline, Storage, NewProduct)
.join(Storage, pipeline_alias1.storage_id ==
storage_alias1.id)
.join(NewProduct, storage_alias2.product_id ==
product_alias1.id)
)
I keep getting:
sqlalchemy.exc.InvalidRequestError: Can't determine which FROM clause
to join from, there are multiple FROMS which can join to this entity.
Please use the .select_from() method to establish an explicit left
side, as well as providing an explicit ON clause if not present
already to help resolve the ambiguity.
How can I tell SQLAlchemy which FROM to use?
Thanks!