Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- latest_event = (
- select(event_table)
- .select_from(
- event_table
- .join(AccountEventAssociation)
- .join(account_table)
- )
- .where(AccountEventAssociation.c.account_id == account.id)
- .where(event_table.c.is_done == true())
- .order_by(event_table.c.end_time.desc())
- .limit(1)
- )
- stmt = (
- select(account_table)
- .select_from(account_table)
- .join(AccountEventAssociation)
- .join(
- latest_event.subquery(),
- latest_event.subquery().c.id == AccountEventAssociation.c.event_id
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment