I keep running into this issue where I have a complex set of filter
parameters, some of which need a join, and it would be nice to have an
ergonomic way to say: join this table, but not if there already is a join.
I found this old post on the subject:
So, I've been a very happy user of SQLAlchemy over many years, though maybe
not very deeply. I certainly don't really feel qualified to contribute any
thoughts on it's design, but I did want to bring this up, since it's
something I have run into again and again.
I'd say that in the majority of
I'm sorry if this is an obvious question, but there seem to be a
couple ways to do joins, and I seem unable to find an example
explaining how to achieve my particular result.
I need to join two tables, and I want the mapper objects of both
tables returned. Essentially, I want
Thanks, that looks like pretty much the thing I need.
Although, as a note, I mostly define my relationships in the opposite
direction than then example in the documentation; That is, I define a
order relationship in the Item model, with a items backref, which
I suppose is just a question of
I have, simplified, the following models:
class Booking(db.Model):
id = db.Column(db.Integer, primary_key=True)
class PlanBooking(Booking):
id = db.Column(db.Integer, db.ForeignKey(Booking.id),
primary_key=True)
class FeatureBooking(Booking):
id = db.Column(db.Integer,