Changeset 2170
- Timestamp:
- 30 Aug 2007, 06:20:15 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/apply_pume_manage.py
r2169 r2170 54 54 object = {} 55 55 ds = [] 56 found = False 56 57 57 58 validate = not search … … 59 60 if reg_no: 60 61 brains = context.applicants_catalog(reg_no = reg_no) 61 62 62 63 if len(brains) == 1: 64 found = True 63 65 for field in context.applicants_catalog.schema(): 64 66 object[field] = getattr(brains[0],field,None) … … 71 73 commit = False, 72 74 ) 73 74 75 75 76 77 76 78 if psm == 'invalid': 77 79 return context.apply_pume_manage_form(rendered = res, … … 81 83 ) 82 84 elif psm == '': 83 psm = 'Registration Number not found!' 85 if search and not found: 86 psm = 'Registration Number not found!' 84 87 return context.apply_pume_manage_form(rendered = res, 85 88 psm = psm, … … 89 92 psm = '' 90 93 pass 91 94 92 95 data = {} 93 96 dm = ds.getDataModel() … … 110 113 logger.info('%s edited application record of %s' % (member,reg_no)) 111 114 112 #set_trace()113 115 116 for field in context.applicants_catalog.schema(): 117 object[field] = getattr(brains[0],field,None) 114 118 115 if reg_no: 116 brains = context.applicants_catalog(reg_no = reg_no) 117 if len(brains) == 1: 118 for field in context.applicants_catalog.schema(): 119 object[field] = getattr(brains[0],field,None) 120 res,psm_dummy,ds = lt.renderLayout(layout_id= 'application_manage', 121 schema_id= 'application', 122 layout_mode = "edit", 123 context=context, 124 ob=object, 125 commit = False, 126 ) 127 else: 128 psm = "reg no %s not found" % reg_no 119 res,psm_dummy,ds = lt.renderLayout(layout_id= 'application_manage', 120 schema_id= 'application', 121 layout_mode = "edit", 122 context=context, 123 ob=object, 124 commit = False, 125 ) 126 129 127 130 128 return context.apply_pume_manage_form(rendered = res,
Note: See TracChangeset for help on using the changeset viewer.