Beispiel #1
0
 def activeSchoolyearInfo(self):
     result = {}
     request = self.request
     collator = ICollator(request.locale)
     activeSchoolyear = self.context.getActiveSchoolYear()
     if activeSchoolyear is not None:
         result['title'] = activeSchoolyear.title
         result['hasCourses'] = self.hasCourses(activeSchoolyear)
         result['hasTimetables'] = self.hasTimetableSchemas(
             activeSchoolyear)
         result['groups'] = []
         groups = IGroupContainer(activeSchoolyear)
         for groupId, group in sorted(groups.items(),
                                      cmp=collator.cmp,
                                      key=lambda
                                      (groupId, group): group.title):
             info = {}
             info['id'] = groupId
             info['title'] = group.title
             info['isDefault'] = groupId in defaultGroups
             info['hasMembers'] = bool(list(group.members))
             info['sent'] = groupId in self.customGroupsToImport
             info['membersSent'] = groupId in self.groupsWithMembersToImport
             result['groups'].append(info)
     return result
 def activeSchoolyearInfo(self):
     result = {}
     request = self.request
     collator = ICollator(request.locale)
     activeSchoolyear = self.context.getActiveSchoolYear()
     if activeSchoolyear is not None:
         result['title'] = activeSchoolyear.title
         result['hasCourses'] = self.hasCourses(activeSchoolyear)
         result['hasTimetables'] = self.hasTimetableSchemas(activeSchoolyear)
         result['groups'] = []
         groups = IGroupContainer(activeSchoolyear)
         for groupId, group in sorted(groups.items(),
                                      cmp=collator.cmp,
                                      key=lambda (groupId,group):group.title):
             info = {}
             info['id'] = groupId
             info['title'] = group.title
             info['isDefault'] = groupId in defaultGroups
             info['hasMembers'] = bool(list(group.members))
             info['sent'] = groupId in self.customGroupsToImport
             info['membersSent'] = groupId in self.groupsWithMembersToImport
             result['groups'].append(info)
     return result
Beispiel #3
0
 def __call__(self):
     group_container = IGroupContainer(self.object)
     for group_id, group in list(group_container.items()):
         IDependable(group).removeDependent('')
         del group_container[group_id]
     del group_container.__parent__[group_container.__name__]