- Timestamp:
- 15 Aug 2007, 19:39:58 (17 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPTables.py
r2094 r2099 58 58 security = ClassSecurityInfo() 59 59 meta_type = None 60 60 61 61 def __init__(self,name=None): 62 62 if name == None: 63 63 name = self.name 64 64 ZCatalog.__init__(self,name) 65 65 66 66 def refreshCatalog(self, clear=0, pghandler=None): ###( 67 67 """ don't refresh for a normal table """ … … 391 391 key = "reg_no" 392 392 security = ClassSecurityInfo() 393 393 394 394 def __init__(self,name=None): 395 395 if name == None: … … 415 415 logger.error(em) 416 416 return 417 logger = logging.getLogger('WAeUPTables.Applicants .importCSV')417 logger = logging.getLogger('WAeUPTables.ApplicantsCatalog.importCSV') 418 418 d = self._import(filename,schema,layout,mode,logger) 419 419 if len(d['valid_records']) > 0: … … 557 557 return certificate_res[0].getPath().split('/')[-4] 558 558 559 def get_from_doc_end_level(self,doc,cached_data={}): 559 def get_from_doc_end_level(self,doc,cached_data={}): 560 560 "return the students end_level" 561 561 if doc is None: … … 1004 1004 WAeUPTable.__init__(self, name) 1005 1005 self._queue = [] 1006 1006 1007 1007 def addRecord(self, **data): ###( 1008 1008 """add one record""" 1009 1009 1010 1010 uid = key = "%(student_id)s|%(level_id)s|%(course_id)s" % data 1011 1011 if key in self._queue: … … 1023 1023 return uid 1024 1024 ###) 1025 1025 1026 1026 # def _p_resolveConflict(self, oldstate, committed, newstate): 1027 1027 # # Apply the changes made in going from old to newstate to 1028 1028 # # committed 1029 1029 1030 1030 # # Note that in the case of undo, the olddata is the data for 1031 1031 # # the transaction being undone and newdata is the data for the … … 1077 1077 1078 1078 def updateCourseResults(self,student_id,level_id,portal_catalog_results,course_results): ###( 1079 # query = Eq('path',"%s/campus/students/%s/study_course/%s" % 1079 # query = Eq('path',"%s/campus/students/%s/study_course/%s" % 1080 1080 # (self.portal_url.getPortalPath(), 1081 1081 # student_id, … … 1083 1083 # Eq('portal_type', "StudentCourseResult") 1084 1084 # level_results = self.portal_catalog_real.evalAdvancedQuery(query) 1085 # level_results = [r for r in course_results 1085 # level_results = [r for r in course_results 1086 1086 # if level_id in r.relative_path.split('/')] 1087 1087 course_results_ids = [cr.getId for cr in course_results] … … 1095 1095 data[field] = getattr(course_result_doc,field,'') 1096 1096 data['key'] = key = "%(student_id)s|%(level_id)s|%(course_id)s" % vars() 1097 data['student_id'] = student_id 1098 data['level_id'] = level_id 1097 data['student_id'] = student_id 1098 data['level_id'] = level_id 1099 1099 data['queue_status'] = OBJECT_CREATED 1100 data['code'] = course_id 1100 data['code'] = course_id 1101 1101 self.catalog_object(dict2ob(data), uid=key) 1102 1102 query = Eq('student_id',student_id) & Eq('level_id', level_id) … … 1122 1122 carry_overs = [] 1123 1123 normal = [] 1124 credits = 0 1124 credits = 0 1125 1125 for brain in course_results: 1126 1126 d = {} 1127 credits += int(brain.credits) 1127 credits += int(brain.credits) 1128 1128 for field in self.schema(): 1129 1129 d[field] = getattr(brain,field,'') … … 1161 1161 course_result.getContent().edit(mapping=d) 1162 1162 ###) 1163 1163 1164 1164 security.declareProtected(ModifyPortalContent,"process_queue") ###( 1165 1165 def process_queue(self,limit=None): … … 1237 1237 #import pdb;pdb.set_trace() 1238 1238 for i in xrange(num_objects): 1239 if pghandler: 1239 if pghandler: 1240 1240 pghandler.report(i) 1241 1241 course_result_brain = course_results[i] … … 1249 1249 data[field] = getattr(course_result_doc,field,'') 1250 1250 data['key'] = key = "%(student_id)s|%(level_id)s|%(course_id)s" % vars() 1251 data['student_id'] = student_id 1252 data['level_id'] = level_id 1251 data['student_id'] = student_id 1252 data['level_id'] = level_id 1253 1253 data['queue_status'] = OBJECT_CREATED 1254 1254 self.catalog_object(dict2ob(data), uid=key) -
WAeUP_SRP/trunk/Widgets.py
r2098 r2099 19 19 from Products.WAeUP_SRP.Students import getStudentByRegNo 20 20 from Products.WAeUP_SRP.Academics import makeCertificateCode 21 from Products.ExtFile.ExtFile import ExtFile21 #from Products.ExtFile.ExtFile import ExtFile 22 22 from re import compile 23 23 import logging … … 253 253 """WAeUP Session Widget.""" 254 254 meta_type = 'WAeUP Session Widget' 255 255 256 256 def _getSessions(self): 257 257 current_year = DateTime().year() … … 527 527 if datastructure[self.state_field]: 528 528 v = datastructure[self.state_field] + '_' + v 529 529 530 530 if self.is_required and not len(v): 531 531 datastructure.setError(widget_id, "lga required") … … 538 538 state = datastructure[self.state_field].lower() 539 539 lga = "_".join(datastructure[self.lga_field].lower().split()) 540 datamodel[self.fields[0]] = state + "_" + lga 540 datamodel[self.fields[0]] = state + "_" + lga 541 541 return 1 542 542 … … 711 711 else: 712 712 mode = "edit" 713 if not valid: 713 if not valid: 714 714 err = 'Invalid number' 715 715 elif self.reference == '': … … 1321 1321 meta_type = "Pume Pin Widget" 1322 1322 catalog = "applicants_catalog" 1323 1323 1324 1324 def validate(self, datastructure, **kw): ###( 1325 1325 """Validate datastructure and update datamodel.""" … … 1329 1329 err = 0 1330 1330 mapping = {} 1331 1331 1332 1332 prefix= self.prefix 1333 1333 if prefix.startswith('@'): … … 1389 1389 else: 1390 1390 applicant = datastructure['record'] 1391 if not applicant.pin: 1391 if not applicant.pin: 1392 1392 s_logger.info('%s successfully used PIN %s' % (ref,pin_str)) 1393 1393 d = {} -
WAeUP_SRP/trunk/configure.zcml
r2094 r2099 6 6 7 7 <include file="upgrade.zcml"/> 8 8 9 9 <adapter 10 10 factory=".exportimport.WAeUPTableXMLAdapter" … … 14 14 /> 15 15 16 <five:registerClass 17 class=".TableDirectory.NewStudentsDirectory" 18 meta_type="New Students Directory" 19 permission="cmf.ManagePortal" 20 global="False" 21 /> 16 22 17 23 18 </configure> -
WAeUP_SRP/trunk/profiles/default/applicants_catalog.xml
r2098 r2099 27 27 <column value="course2"/> 28 28 <column value="course3"/> 29 <column value=" testdate"/>29 <column value="screening_date"/> 30 30 <column value="passport"/> 31 31 <column value="status"/> -
WAeUP_SRP/trunk/profiles/default/layouts/application.xml
r2098 r2099 156 156 <property name="css_class_expr">string:row</property> 157 157 </widget> 158 <widget name="ag regate" meta_type="Int Widget">159 <property name="title">JAMB Ag regate Score</property>160 <property name="fields"> 161 <element value="ag regate"/>162 </property> 163 <property name="label">JAMB Ag regate Score</property>164 <property name="label_edit">JAMB Ag regate Score</property>158 <widget name="aggregate" meta_type="Int Widget"> 159 <property name="title">JAMB Aggregate Score</property> 160 <property name="fields"> 161 <element value="aggregate"/> 162 </property> 163 <property name="label">JAMB Aggregate Score</property> 164 <property name="label_edit">JAMB Aggregate Score</property> 165 165 <property name="description"></property> 166 166 <property name="help"></property> … … 444 444 <property name="css_class_expr">string:row</property> 445 445 </widget> 446 <widget name=" testdate" meta_type="DateTime Widget">447 <property name="title"> TestDate</property>448 <property name="fields"> 449 <element value=" testdate"/>450 </property> 451 <property name="label"> TestDate</property>452 <property name="label_edit"> TestDate</property>446 <widget name="screening_date" meta_type="DateTime Widget"> 447 <property name="title">Screening Date</property> 448 <property name="fields"> 449 <element value="screening_date"/> 450 </property> 451 <property name="label">Screening Date</property> 452 <property name="label_edit">Screening Date</property> 453 453 <property name="description"></property> 454 454 <property name="help"></property> … … 593 593 </row> 594 594 <row> 595 <cell name="ag regate" ncols="2"/>595 <cell name="aggregate" ncols="2"/> 596 596 </row> 597 597 </table> -
WAeUP_SRP/trunk/profiles/default/schemas/application.xml
r2095 r2099 16 16 <field name="subj3" meta_type="CPS Int Field"/> 17 17 <field name="subj3score" meta_type="CPS Int Field"/> 18 <field name="ag regate" meta_type="CPS Int Field"/>18 <field name="aggregate" meta_type="CPS Int Field"/> 19 19 <field name="lastname" meta_type="CPS String Field"/> 20 20 <field name="middlenames" meta_type="CPS String Field"/> … … 28 28 <field name="sex" meta_type="CPS Boolean Field"/> 29 29 <field name="lga" meta_type="CPS String Field"/> 30 <field name=" testdate" meta_type="CPS DateTime Field"/>30 <field name="screening_date" meta_type="CPS DateTime Field"/> 31 31 <field name="passport" meta_type="CPS String Field"/> 32 32 <field name="status" meta_type="CPS String Field"/>
Note: See TracChangeset for help on using the changeset viewer.