Changeset 10206
- Timestamp:
- 22 May 2013, 19:26:05 (11 years ago)
- Location:
- main/waeup.futminna/trunk/src/waeup/futminna/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna/applicants/applicant.py
r10146 r10206 42 42 grok.provides(ICustomApplicant) 43 43 44 @property 45 def low_jamb_score(self): 46 jamb_score = getattr(self, 'jamb_score', None) 47 course1 = getattr(self, 'course1', None) 48 limit = getattr(course1, 'custom_float_1', None) 49 if None in (jamb_score, limit): 50 return False 51 if jamb_score < limit: 52 return True 53 return False 54 44 55 # Set all attributes of CustomApplicant required in ICustomApplicant as field 45 56 # properties. Doing this, we do not have to set initial attributes -
main/waeup.futminna/trunk/src/waeup/futminna/applicants/browser.py
r10105 r10206 38 38 PG_OMIT_PDF_FIELDS, 39 39 PG_OMIT_MANAGE_FIELDS, 40 PG_OMIT_EDIT_FIELDS, 40 PUTME_OMIT_EDIT_FIELDS, 41 PUTME_OMIT_DISPLAY_FIELDS, 42 PUTME_OMIT_PDF_FIELDS, 43 PUTME_OMIT_MANAGE_FIELDS, 44 PUTME_OMIT_EDIT_FIELDS, 41 45 ) 42 46 from waeup.futminna.interfaces import MessageFactory as _ … … 113 117 if not getattr(self.context, 'screening_date'): 114 118 form_fields = form_fields.omit('screening_date') 119 if not self.context.low_jamb_score: 120 form_fields = form_fields.omit('course2') 115 121 return form_fields 116 122 … … 130 136 for field in PG_OMIT_PDF_FIELDS: 131 137 form_fields = form_fields.omit(field) 138 elif target is not None and target.startswith('putme'): 139 form_fields = grok.AutoFields(ICustomUGApplicant) 140 if self._reduced_slip(): 141 for field in PUTME_OMIT_RESULT_SLIP_FIELDS: 142 form_fields = form_fields.omit(field) 132 143 else: 133 144 form_fields = grok.AutoFields(ICustomUGApplicant) … … 142 153 if not getattr(self.context, 'screening_date'): 143 154 form_fields = form_fields.omit('screening_date') 155 if not self.context.low_jamb_score: 156 form_fields = form_fields.omit('course2') 144 157 return form_fields 145 158 … … 155 168 form_fields = grok.AutoFields(ICustomPGApplicant) 156 169 for field in PG_OMIT_MANAGE_FIELDS: 170 form_fields = form_fields.omit(field) 171 elif target is not None and target.startswith('putme'): 172 form_fields = grok.AutoFields(ICustomUGApplicant) 173 for field in PUTME_OMIT_MANAGE_FIELDS: 157 174 form_fields = form_fields.omit(field) 158 175 else: … … 199 216 for field in PG_OMIT_EDIT_FIELDS: 200 217 form_fields = form_fields.omit(field) 218 elif target is not None and target.startswith('putme'): 219 form_fields = grok.AutoFields(ICustomUGApplicantEdit) 220 for field in PUTME_OMIT_EDIT_FIELDS: 221 form_fields = form_fields.omit(field) 201 222 else: 202 223 form_fields = grok.AutoFields(ICustomUGApplicantEdit) … … 205 226 form_fields['applicant_id'].for_display = True 206 227 form_fields['reg_number'].for_display = True 228 if not self.context.low_jamb_score: 229 form_fields = form_fields.omit('course2') 207 230 return form_fields 208 231
Note: See TracChangeset for help on using the changeset viewer.