Skip to content
This repository

RecurrenceSupport.occurrences goes through whole recurrence set #60

Closed
thet opened this Issue September 27, 2012 · 1 comment

2 participants

Johannes Raggam Roman Joost
Johannes Raggam
Collaborator

@romanofski

plone.app.event.recurrence.RecurrenceSupport.occurrences goes through whole recurrence set. the set can be quite big until unlimited. although we would have another problem with unlimited recurrences at indexing time at the moment (will get solved with plone.eventindex from regebro), we should avoid to go through the whole recurrence set. at the current state we go through every time the event_view is called.

the source of the problem is here:
https://github.com/plone/plone.app.event/blob/master/plone/app/event/recurrence.py#L66
recurrence_sequence_ical returns an generator. the occurrences method mentioned here returns a list.
it can be changed to return a generator, but then it might not possible to get the last occurrence without iterating through the whole list (generators don't support slicing like _list[-1]) (this method needs to get the last occurrence: plone.app.event.browser.event_view.EventView._get_occurrences_helper.)

i'm not sure, if we can find a solution for this.

Roman Joost

Totally agree. I've seen it when changing the event view to limit the amount of occurrences to be rendered (why have I not created a ticket). Perhaps the issue is rather figuring out if the recurrence ends or is unlimited. Perhaps even where this is important to know (only in a view or do we need to know about it somewhere else).

Johannes Raggam thet referenced this issue from a commit February 13, 2014
Johannes Raggam Change the event detail listing in the event_view to be a definition …
…list instead of a table, making it semantically more correct and the code less verbose. Fixes #141.

For recurring events, don't show the last recurrence in the event view but the number of occurrences, queried from the catalog. Together with the previous generator-change this looping over the whole occurrnce list.
Change the IRecurrenceSupport adapter's occurrence method to return again a generator, fixing a possible performance issue. Fixes #60.
daed1ca
Johannes Raggam thet closed this issue from a commit February 13, 2014
Johannes Raggam Change the event detail listing in the event_view to be a definition …
…list instead of a table, making it semantically more correct and the code less verbose. Fixes #141.

For recurring events, don't show the last recurrence in the event view but the number of occurrences, queried from the catalog. Together with the previous generator-change this looping over the whole occurrnce list.
Change the IRecurrenceSupport adapter's occurrence method to return again a generator, fixing a possible performance issue. Fixes #60.
03cb5cf
Johannes Raggam thet closed this in 03cb5cf February 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.