Russell Keith-Magee wrote:
From my context, Article.objects() constructs a basic query that knows
how to return all object instances of type Article, which can then be
filtered to produce more complex query objects. The idea that there is
a single basic query which everyone should use doesn't really make
much sense
Why not? Article.objects represent a concept of 'select * from table' -
a single immutable query which serves as a basis for appending to it
filters, orders etc. There is no need (semantically) to construct such
basic query each time since all later alterations don't actually change
the query but only use it as a prototype and produce new instances
themselves.
Article.objects() would be appropriate for this case:
q = Article.objects()
q.filter(...)
q.order(...)
for row in q:
...
But somewhere near we've already agreed that methods producing new
instances would be more useful.
The rest of the confusion (at least on my part) stems is that there
are a lot of references in this thread and the wiki to Article.objects
being the Manager, with all()/filter() etc being used to get sets from
the Manager;
There is a proposition also somewhere near this discussion to let
Manager be also a basic Query. Which turns out to cause a certain confusion.