- Timestamp:
- 22 Jun 2013, 21:39:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.imostate/src/waeup/imostate/applicants/browser.py
r10340 r10350 28 28 ICustomApplicant, 29 29 ICustomUGApplicant, 30 ICustomPGApplicant,31 ICustomPGApplicantEdit,32 30 ICustomUGApplicantEdit, 33 UG_OMIT_DISPLAY_FIELDS,34 UG_OMIT_PDF_FIELDS,35 UG_OMIT_MANAGE_FIELDS,36 UG_OMIT_EDIT_FIELDS,37 PG_OMIT_DISPLAY_FIELDS,38 PG_OMIT_PDF_FIELDS,39 PG_OMIT_MANAGE_FIELDS,40 PG_OMIT_EDIT_FIELDS,41 PUTME_OMIT_EDIT_FIELDS,42 PUTME_OMIT_DISPLAY_FIELDS,43 PUTME_OMIT_PDF_FIELDS,44 PUTME_OMIT_MANAGE_FIELDS,45 PUTME_OMIT_EDIT_FIELDS,46 31 ) 47 32 from waeup.imostate.interfaces import MessageFactory as _ … … 102 87 @property 103 88 def form_fields(self): 104 if self.target is not None and self.target.startswith('pg'): 105 form_fields = grok.AutoFields(ICustomPGApplicant) 106 for field in PG_OMIT_DISPLAY_FIELDS: 107 form_fields = form_fields.omit(field) 108 else: 109 form_fields = grok.AutoFields(ICustomUGApplicant) 110 for field in UG_OMIT_DISPLAY_FIELDS: 111 form_fields = form_fields.omit(field) 89 form_fields = grok.AutoFields(ICustomUGApplicant) 112 90 if form_fields.get('perm_address', None): 113 91 form_fields['perm_address'].custom_widget = BytesDisplayWidget … … 121 99 if not getattr(self.context, 'screening_date'): 122 100 form_fields = form_fields.omit('screening_date') 123 if not self.context.low_jamb_score:124 form_fields = form_fields.omit('course2')125 101 return form_fields 126 102 … … 136 112 @property 137 113 def form_fields(self): 138 if self.target is not None and self.target.startswith('pg'): 139 form_fields = grok.AutoFields(ICustomPGApplicant) 140 for field in PG_OMIT_PDF_FIELDS: 141 form_fields = form_fields.omit(field) 142 elif self.target is not None and self.target.startswith('putme'): 143 form_fields = grok.AutoFields(ICustomUGApplicant) 144 if self._reduced_slip(): 145 for field in PUTME_OMIT_RESULT_SLIP_FIELDS: 146 form_fields = form_fields.omit(field) 147 else: 148 form_fields = grok.AutoFields(ICustomUGApplicant) 149 for field in UG_OMIT_PDF_FIELDS: 150 form_fields = form_fields.omit(field) 114 form_fields = grok.AutoFields(ICustomUGApplicant) 151 115 if not getattr(self.context, 'student_id'): 152 116 form_fields = form_fields.omit('student_id') … … 157 121 if not getattr(self.context, 'screening_date'): 158 122 form_fields = form_fields.omit('screening_date') 159 if not self.context.low_jamb_score:160 form_fields = form_fields.omit('course2')161 123 return form_fields 162 124 … … 168 130 @property 169 131 def form_fields(self): 170 if self.target is not None and self.target.startswith('pg'): 171 form_fields = grok.AutoFields(ICustomPGApplicant) 172 for field in PG_OMIT_MANAGE_FIELDS: 173 form_fields = form_fields.omit(field) 174 elif self.target is not None and self.target.startswith('putme'): 175 form_fields = grok.AutoFields(ICustomUGApplicant) 176 for field in PUTME_OMIT_MANAGE_FIELDS: 177 form_fields = form_fields.omit(field) 178 else: 179 form_fields = grok.AutoFields(ICustomUGApplicant) 180 for field in UG_OMIT_MANAGE_FIELDS: 181 form_fields = form_fields.omit(field) 132 form_fields = grok.AutoFields(ICustomUGApplicant) 182 133 form_fields['student_id'].for_display = True 183 134 form_fields['applicant_id'].for_display = True … … 223 174 @property 224 175 def form_fields(self): 225 if self.target is not None and self.target.startswith('pg'): 226 form_fields = grok.AutoFields(ICustomPGApplicantEdit) 227 for field in PG_OMIT_EDIT_FIELDS: 228 form_fields = form_fields.omit(field) 229 elif self.target is not None and self.target.startswith('putme'): 230 form_fields = grok.AutoFields(ICustomUGApplicantEdit) 231 for field in PUTME_OMIT_EDIT_FIELDS: 232 form_fields = form_fields.omit(field) 233 else: 234 form_fields = grok.AutoFields(ICustomUGApplicantEdit) 235 for field in UG_OMIT_EDIT_FIELDS: 236 form_fields = form_fields.omit(field) 176 form_fields = grok.AutoFields(ICustomUGApplicantEdit) 237 177 form_fields['applicant_id'].for_display = True 238 178 form_fields['reg_number'].for_display = True 239 if not self.context.low_jamb_score:240 form_fields = form_fields.omit('course2')241 179 return form_fields 242 180
Note: See TracChangeset for help on using the changeset viewer.