I think the biggest criticism to an idea like this is that it
introduces a lot of complexity without solving all the problems you
need to solve. For example, what if you need to form a join with
another table that goes beyond polls_choices.
An alternative is to generate some other function that directly calls
the database - and you can do that currently (cursor.execute). The only
downside is that it is not database-agnostic, but considering the
limited number of times this is required that seems like a reasonable
cost.
I think at some point we go beyond that area where flexibility and
simplicity are both in harmony, and IMHO the syntax above is an
example.

Having said that, there are some useful and very common operations that
we should support. You could have used one of them -
poll.get_choice_count() - there may be some others that are both simple
to use and commonly used. For one, I think "sum" might fall into that
category.

 -rob

Reply via email to