7. How will queries work on collections?
For instance, if the calendar wants to query all items in a collection, within a given date range?
Decision
Collections will be first class citizens with respect to queries - you'll be able to pass them in as parameters to queries, such as:
query = MakeQuery("for i in '%s' where i.startDate <= '3/3/2005 03:15", collection)
(Ted, did I get this right?
A Query is a predicate applied to a Set/Collection of items. In the new world, you will be able to apply predicates to any collection of item. At the moment this happens via a FilteredCollection kind which accepts the predicate as an argument. Right now my intention is to support the predicate language from the existing Query implemenatation. I have a feeling the Phillip may be interested in something more Pythonic, which may also be a possiblity. Concretely:
c = UserCollection(.....)
fc = FilteredCollection(c, "i.startDate < '3/3/2005 03:15'")
fc is itself a collection and can be used anywhere a collection would be used.
The existing query classes will go away, to be replaced by FilteredCollections of other types of Collections.
8. How will the autogeneration of recurring items happen?
We need a mechanism so that if you query a collection on a given date range, the appropriate recurring items are created.
Decision
Ted is trying to make a pluggable system so that when a given attribute (or is it Kind?) is searched, a callback mechanism can be triggered to allow the creation of the items before the query actually runs, so the query finds them.
I believe that this is feasible but have not worked out the precise details.