def evolveScheduleContainers(app): annotations = IAnnotations(app) prefs = getApplicationPreferences(app) schedule_containers = app[SCHEDULES_KEY] for container in schedule_containers.values(): if container.timezone != prefs.timezone: container.timezone = prefs.timezone zope.lifecycleevent.modified(container)
def evolveTimetableContainers(app): annotations = IAnnotations(app) prefs = getApplicationPreferences(app) schedule_containers = app[TIMETABLES_KEY] for container in schedule_containers.values(): for timetable in container.values(): if timetable.timezone != prefs.timezone: timetable.timezone = prefs.timezone zope.lifecycleevent.modified(timetable)
def initializePreferences(self, app): prefs = getApplicationPreferences(app) prefs.initializeTimezone()