Changeset 3781 for WAeUP_SRP/trunk/WAeUPTables.py
- Timestamp:
- 22 Nov 2008, 15:34:16 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPTables.py
r3780 r3781 1028 1028 1029 1029 def reindexIndex(self, name, REQUEST,pghandler=None): ###( 1030 if not hasattr(self,'_v_certificates'): 1031 self._v_certificates = self.fill_certificates_dict() 1030 1032 if isinstance(name, str): 1031 1033 name = (name,) … … 1033 1035 reindex_special = [] 1034 1036 for n in name: 1035 if n in ("review_state" ,"registered_courses"):1037 if n in ("review_state"): 1036 1038 reindex_special.append(n) 1037 1039 else: … … 1043 1045 reindextypes[pt]= [n] 1044 1046 break 1045 cached_data = {}1046 if set(name).intersection(set(('faculty','department','end_level'))):1047 cached_data = self.fill_certificates_dict()1047 #cached_data = {} 1048 #if set(name).intersection(set(('faculty','department','end_level','mode'))): 1049 # cached_data = self.fill_certificates_dict() 1048 1050 students = self.portal_catalog(portal_type="Student") 1049 1051 if hasattr(self,'portal_catalog_real'): … … 1060 1062 student_brain = students[i] 1061 1063 student_object = student_brain.getObject() 1062 # query = Eq('path',student_brain.getPath())1063 # sub_brains_list = aq_portal(query)1064 # sub_brains = {}1065 # for sub_brain in sub_brains_list:1066 # sub_brains[sub_brain.portal_type] = sub_brain1067 # student_path = student_brain.getPath()1068 1064 data = {} 1069 1065 modified = False … … 1077 1073 try: 1078 1074 doc = getattr(student_object,self.affected_types[pt]['id']).getContent() 1079 #doc = sub_brains[pt].getObject().getContent()1080 # path = "%s/%s" % (student_path,self.affected_types[pt]['id'])1081 # doc = self.unrestrictedTraverse(path).getContent()1082 1075 sub_objects = True 1083 1076 except: … … 1085 1078 for field in set(name).intersection(self.affected_types[pt]['fields']): 1086 1079 if hasattr(self,'get_from_doc_%s' % field): 1087 data[field] = getattr(self,'get_from_doc_%s' % field)(doc, 1088 cached_data=cached_data) 1080 data[field] = getattr(self,'get_from_doc_%s' % field)(doc) 1089 1081 else: 1090 1082 data[field] = getattr(doc,field) … … 1100 1092 import_record.Lastname) 1101 1093 data['jamb_reg_no'] = import_record.Entryregno 1102 #if reindex_special and 'registered_courses' in reindex_special:1103 # try:1104 # study_course = getattr(student_object,"study_course")1105 # level_ids = study_course.objectIds()1106 # except:1107 # continue1108 # if not level_ids:1109 # continue1110 # modified = True1111 # level_ids.sort()1112 # course_ids = getattr(study_course,level_ids[-1]).objectIds()1113 # courses = []1114 # for c in course_ids:1115 # if c.endswith('_co'):1116 # courses.append(c[:-3])1117 # else:1118 # courses.append(c)1119 # data['registered_courses'] = courses1120 1094 if modified: 1121 1095 self.modifyRecord(**data) … … 1130 1104 students = self.portal_catalog(portal_type="Student") 1131 1105 num_objects = len(students) 1132 cached_data = self.fill_certificates_dict() 1106 #cached_data = self.fill_certificates_dict() 1107 if not hasattr(self,'_v_certificates'): 1108 self._v_certificates = self.fill_certificates_dict() 1133 1109 if pghandler: 1134 1110 pghandler.init('Refreshing catalog: %s' % self.absolute_url(1), num_objects)
Note: See TracChangeset for help on using the changeset viewer.