On Jun 30, 2005, at 23:24, Ted Leung wrote:

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.

My understanding of the recurrence spec is that CalendarEventMixin has a method

  • getOccurrencesBetween(start, end) -> check for virtual events that end after start and start before end, create any that don't already exist, return an iterable of events ordered by startTime

In the given case, don't we just need to run this on each calendar event in the collection we're given? i.e. adding a "pregeneration" callback API, and compiling a query, seem overly complex to me. (Of course, there are plenty of other use cases for FilteredCollections).

--Grant

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to