Changeset 463
- Timestamp:
- 1 Sep 2006, 10:33:30 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Widgets.py
r444 r463 207 207 208 208 InitializeClass(StudentIdWidget) 209 210 209 widgetRegistry.register(StudentIdWidget) 211 210 212 ##Class StudentIdWidgetType(CPSWidgetType): 213 ## """Student Id String widget type.""" 214 ## meta_type = "StudentId Widget Type" 215 ## cls = StudentIdWidget 216 211 ###) 212 213 class JambRegNoWidget(CPSStringWidget): ###( 214 """ JambRegNo Widget""" 215 meta_type = "JambRegNo Widget" 216 digits = 8 217 digits_str = "N"*digits 218 letters = 2 219 letters_str = "L"*letters 220 221 def validate(self, datastructure, **kw): 222 """Validate datastructure and update datamodel.""" 223 224 valid = CPSStringWidget.validate(self, datastructure, **kw) 225 if not valid: 226 return 0 227 else: 228 widget_id = self.getWidgetId() 229 value = datastructure[widget_id] 230 err = 0 231 if not (len(value) == self.digits + self.letters and value[:self.digits].isdigit() and value[self.digits:].isalpha()): 232 err = 'Invalid Registration Number in the format: %s%s with N = Number, L = Letter' % (self.digits_str,self.letters_str) 233 else: 234 search = self.portal_catalog({'meta_type': 'StudentAdmission', 235 'jamb_reg_no': value, 236 }) 237 if len(search) < 1: 238 err = 'No JAMB data for %s' % (value) 239 if err: 240 datastructure.setError(widget_id, err) 241 else: 242 datamodel = datastructure.getDataModel() 243 datamodel[self.fields[0]] = value 244 245 return not err 246 247 InitializeClass(JambRegNoWidget) 248 249 widgetRegistry.register(JambRegNoWidget) 217 250 ###) 218 251 -
WAeUP_SRP/trunk/profiles/default/layouts.xml
r458 r463 11 11 <object name="faculty" meta_type="CPS Layout"/> 12 12 <object name="student" meta_type="CPS Layout"/> 13 <object name="student_check_pin" meta_type="CPS Layout"/> 13 14 <object name="student_study_course" meta_type="CPS Layout"/> 14 15 <object name="student_admission" meta_type="CPS Layout"/> -
WAeUP_SRP/trunk/skins/waeup_student/request_admission.py
r461 r463 47 47 if len(search) < 1: 48 48 psm = "No JAMB record %s" % (jamb_id) 49 return context. check_admission_form(rendered = res,49 return context.request_admission_form(rendered = res, 50 50 psm = psm, 51 51 ds = ds, … … 55 55 return student.acknowledge_slip() 56 56 57 jamb = getattr(student,'admission')58 res = jamb.getContent().render(layout_id = 'admission_slip',59 layout_mode = 'view',60 schema_id = 'jamb')61 57 62 return context.admission_slip_form(rendered = res, dict = ds)63
Note: See TracChangeset for help on using the changeset viewer.