Пример #1
0
 def getTargets(self, keys):
     if not keys:
         return []
     result = []
     sy_groups = {}
     app = ISchoolToolApplication(None)
     schoolyears = ISchoolYearContainer(app)
     for key in keys:
         for sy_name, schoolyear in schoolyears.items():
             if not key.startswith(sy_name+'.'):
                 continue
             if sy_name not in sy_groups:
                 sy_groups[sy_name] = IGroupContainer(schoolyear)
             group = sy_groups[sy_name].get(key[len(sy_name)+1:])
             if group is not None:
                 result.append(group)
     return result
Пример #2
0
 def getTargets(self, keys):
     if not keys:
         return []
     result = []
     sy_groups = {}
     app = ISchoolToolApplication(None)
     schoolyears = ISchoolYearContainer(app)
     for key in keys:
         for sy_name, schoolyear in schoolyears.items():
             if not key.startswith(sy_name + '.'):
                 continue
             if sy_name not in sy_groups:
                 sy_groups[sy_name] = IGroupContainer(schoolyear)
             group = sy_groups[sy_name].get(key[len(sy_name) + 1:])
             if group is not None:
                 result.append(group)
     return result