This repository has been archived by the owner on May 6, 2024. It is now read-only.
forked from glamkit/glamkit-eventtools
-
Notifications
You must be signed in to change notification settings - Fork 13
/
CHANGES.txt
43 lines (30 loc) · 1.96 KB
/
CHANGES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
v0.5.0, 2010-06-22 -- Initial release.
v0.5.1, 2010-06-22 -- Fixed setup.py bug.
v0.9.0, 2010-09-26 -- Refactored to have more consistent treatment of dateranges.
Occurrence.start and Occurrence.end methods are deprecated;
instead use Occurrence.timespan.start etc.
-------------------------------------------------------------------------------
2011-09-06 -- Major backwards incompatibility:
This revision contains a breaking change in the Occurrence and Generator models, to use start + duration, rather than
start + end, and to have consistency between their APIs.
The Generator model repeat_until is now a date, rather than a datetime, for simplicity (only one occurrence per day is
generated).
See UPGRADING.txt for sample code for migrations.
-------------------------------------------------------------------------------
2011-03-23 -- Possible backwards incompatibility:
[EDIT 2011-09-06 - later changes now render this validation check obsolete]
This revision introduces a validation check to ensure events marked as daily do
not span more than 24 hours. If such events exist in your database, the
following code should be executed from the Django shell BEFORE upgrading
eventtools to fix the newly invalid occurrences (note that it may take quite a
while to execute):
from datetime import timedelta
from events.models import Generator # Or wherever your subclass of GeneratorModel lives
for generator in [g for g in Generator.objects.filter(rule__frequency='DAILY') if g.event_end - g.event_start > timedelta(1)]:
if not generator.repeat_until:
generator.repeat_until = generator.event_end
generator.event_end = generator.event_end.replace(*generator.event_start.timetuple()[:3])
generator.save()
# Review the occurrences to be deleted with caution before executing this
len([o.delete() for o in Occurrence.objects.filter(generator__rule__frequency='DAILY') if o.start.date() != o.end.date()])
-------------------------------------------------------------------------------