You can't just append a COUNT to an SQL query, you'd have to write two queries, or one query that returned both. The above code produces two different queries, so it's much more composable.
I use it for tacking on extra filtering terms as well:
if category:
published_posts = published_posts.filter(category=category)
I use it for tacking on extra filtering terms as well: