Changeset 7270 for main/waeup.sirp/trunk/src
- Timestamp:
- 4 Dec 2011, 17:50:45 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py
r7260 r7270 91 91 access_code = index.Field(attribute='access_code') 92 92 applicant_id = index.Field(attribute='applicant_id') 93 reg_n o = index.Field(attribute='reg_no')93 reg_number = index.Field(attribute='reg_number') 94 94 95 95 class ApplicantFactory(grok.GlobalUtility): -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/batching.py
r7268 r7270 88 88 def available_fields(self): 89 89 return sorted(list(set( 90 ['application_number','reg_n o'] + getFields(90 ['application_number','reg_number'] + getFields( 91 91 self.iface).keys()))) 92 92 93 93 def checkHeaders(self, headerfields, mode='create'): 94 if not 'reg_n o' in headerfields and not 'application_number' \94 if not 'reg_number' in headerfields and not 'application_number' \ 95 95 in headerfields: 96 96 raise FatalCSVError( 97 "Need at least columns application_number or reg_n o")97 "Need at least columns application_number or reg_number ") 98 98 if mode == 'create': 99 99 for field in self.required_fields: … … 114 114 if row.get('application_number',None): 115 115 return 'application_number' 116 elif 'reg_n o' in row.keys() and row['reg_no']:117 return 'reg_n o'116 elif 'reg_number' in row.keys() and row['reg_number']: 117 return 'reg_number' 118 118 else: 119 119 return None … … 135 135 applicant = parent[row['application_number']] 136 136 return applicant 137 elif self.getLocator(row) == 'reg_n o':138 reg_n o = row['reg_no']137 elif self.getLocator(row) == 'reg_number': 138 reg_number = row['reg_number'] 139 139 cat = queryUtility(ICatalog, name='applicants_catalog') 140 140 results = list( 141 cat.searchResults(reg_n o=(reg_no, reg_no)))141 cat.searchResults(reg_number=(reg_number, reg_number))) 142 142 if results: 143 143 return results[0] … … 167 167 for num, field in enumerate(headerfields): 168 168 if field not in ['container_code', 169 'application_number', 'reg_n o'] and mode == 'remove':169 'application_number', 'reg_number'] and mode == 'remove': 170 170 continue 171 171 if field == u'--IGNORE--': … … 179 179 """ 180 180 if mode in ['update', 'remove']: 181 if self.getLocator(row) == 'reg_n o':181 if self.getLocator(row) == 'reg_number': 182 182 iface = IApplicantUpdateByRegNo 183 183 else: -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7263 r7270 931 931 form_fields = grok.AutoFields(IApplicantEdit).omit( 932 932 'locked', 'course_admitted', 'student_id', 933 'screening_score', 'applicant_id', 'reg_n o'933 'screening_score', 'applicant_id', 'reg_number' 934 934 ) 935 935 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r7268 r7270 53 53 implements(ISource) 54 54 cat_name = 'applicants_catalog' 55 field_name = 'reg_n o'55 field_name = 'reg_number' 56 56 validation_error = RegNumInSource 57 57 def __init__(self, context): … … 298 298 readonly = False, 299 299 ) 300 reg_n o= TextLineChoice(300 reg_number = TextLineChoice( 301 301 title = u'JAMB Registration Number', 302 302 readonly = False, … … 446 446 """Representation of an applicant. 447 447 448 Skip regular reg_n o validation if reg_nois used for finding448 Skip regular reg_number validation if reg_number is used for finding 449 449 the applicant object. 450 450 """ 451 reg_n o= schema.TextLine(451 reg_number = schema.TextLine( 452 452 title = u'Registration Number', 453 453 default = None, -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/sample_applicant_data.csv
r7263 r7270 1 container_code,reg_n o,firstname,lastname,date_of_birth,email,course11 container_code,reg_number,firstname,lastname,date_of_birth,email,course1 2 2 dp2011,1001,Aaren,Pieri,1990-01-02,xx@yy.zz,CERT1 3 3 dp2011,1002,Aaren,Finau,1990-01-03,xx@yy.zz,CERT1 -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/sample_applicant_data_update.csv
r7263 r7270 1 container_code,reg_n o,firstname1 container_code,reg_number,firstname 2 2 dp2011,1001,Aaren 3 3 dp2011,1002,Alfons -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py
r7263 r7270 118 118 # Add an applicant 119 119 self.applicant = Applicant() 120 # reg_n ois the only field which has to be preset here120 # reg_number is the only field which has to be preset here 121 121 # because managers are allowed to edit this required field 122 self.applicant.reg_n o= u'1234'122 self.applicant.reg_number = u'1234' 123 123 app['applicants']['app2009'].addApplicant(self.applicant) 124 124 IUserAccount(
Note: See TracChangeset for help on using the changeset viewer.