Re: [sqlalchemy] How do I access a column that is the result of an outerjoined subquery?

2022-07-10 Thread Montana Burr
s( > with_expression( > Entry.daily_calorie_sum_less_than_expected, > > query_calorie_sum_less_than_expected.c.daily_calorie_sum_less_than_expected, > ) > ) > .outerjoin( > query_calorie_sum_less_than_expected, > Entry.user_id

Re: [sqlalchemy] How do I access a column that is the result of an outerjoined subquery?

2022-07-10 Thread Montana Burr
s_than_expected'" On Sunday, July 10, 2022 at 10:20:12 AM UTC-6 Montana Burr wrote: > Thank you, Mike, and apologies for not providing a stack trace or MCVE of > my own - I assumed the code I did provide was sufficient. > > So, take your program and add > > for

Re: [sqlalchemy] How do I access a column that is the result of an outerjoined subquery?

2022-07-10 Thread Montana Burr
username="u1", > entries=[Entry()], > daily_expected_calories=[ > DailyExpectedCalories( > date=datetime.date.today(), expected_Calories=2000 > ) >

[sqlalchemy] Re: How do I access a column that is the result of an outerjoined subquery?

2022-07-09 Thread Montana Burr
Or, is the query right? And if so, how do I get the "daily_calorie_sum_less_than_expected" column? On Saturday, July 9, 2022 at 2:12:35 PM UTC-6 Montana Burr wrote: > Hi folks! > > I have a rather complicated SQL query to perform. I kind of know how I > would do it

[sqlalchemy] How do I access a column that is the result of an outerjoined subquery?

2022-07-09 Thread Montana Burr
Hi folks! I have a rather complicated SQL query to perform. I kind of know how I would do it in SQL and am looking to port it to SQLAlchemy. I have these ORM classes: class User(Base): __tablename__ = "Users" id = Column(Integer, primary_key=True) username = Column(String)

[sqlalchemy] How do I build a set of persistent objects that fetch data from an external API?

2022-05-05 Thread Montana Burr
I have a Parent and a Child class with a many-to-many relationship between the two. Both classes are populated with data from an external API. When pulling info on the Child from the API, the API will also give me the identifiers of the Parents, some of whom may not be in the database, but the