Hey team -

I'm trying to figure out how to basically rewrite this:
SELECT
count(task.id) 
FROM task
JOIN round on task.game_id = round.game_id
JOIN tournament ON round.tournament_id = tournament.id
WHERE tournament.id = '626aeaa7-783b-415c-85f9-5222d9c95973';

As this:
total_tasks = column_property(
        select([func.count(Task.id)])
        .outerjoin(Round, Task.game_id == Round.game_id)
        .filter(round.tournament_id == tournament_id)
        .correlate_except(Task))

I keep getting the following error:
AttributeError: 'Join' object has no attribute 'filter'

Which I *know* tells me that a join object has no method called "filter", 
but there's also no "where", "filter_by" etc...

What painfully obvious thing am I missing?

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/ad3b421d-bf9f-43bd-bd1a-061136572200%40googlegroups.com.

Reply via email to