Changeset 8519 for main/waeup.uniben/trunk
- Timestamp:
- 25 May 2012, 10:30:40 (12 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r8506 r8519 37 37 from waeup.uniben.applicants.interfaces import ( 38 38 IPGApplicant, IUGApplicant, IPGApplicantEdit, IUGApplicantEdit, 39 ICustomApplicantOnlinePayment) 39 ICustomApplicantOnlinePayment, 40 UG_OMIT_DISPLAY_FIELDS, PG_OMIT_DISPLAY_FIELDS, 41 UG_OMIT_MANAGE_FIELDS, PG_OMIT_MANAGE_FIELDS, 42 UG_OMIT_EDIT_FIELDS, PG_OMIT_EDIT_FIELDS) 40 43 from waeup.uniben.interfaces import MessageFactory as _ 41 44 … … 65 68 target = getattr(self.context.__parent__, 'prefix', None) 66 69 if target is not None and target.startswith('pg'): 67 form_fields = grok.AutoFields(IPGApplicant).omit( 68 'locked', 'course_admitted') 70 form_fields = grok.AutoFields(IPGApplicant) 71 for field in PG_OMIT_DISPLAY_FIELDS: 72 form_fields = form_fields.omit(field) 69 73 else: 70 form_fields = grok.AutoFields(IUGApplicant).omit( 71 'locked', 'course_admitted') 74 form_fields = grok.AutoFields(IUGApplicant) 75 for field in UG_OMIT_DISPLAY_FIELDS: 76 form_fields = form_fields.omit(field) 72 77 return form_fields 73 78 … … 80 85 target = getattr(self.context.__parent__, 'prefix', None) 81 86 if target is not None and target.startswith('pg'): 82 form_fields = grok.AutoFields(IPGApplicant).omit( 83 'locked', 'course_admitted', 'password') 87 form_fields = grok.AutoFields(IPGApplicant) 88 for field in PG_OMIT_DISPLAY_FIELDS: 89 form_fields = form_fields.omit(field) 84 90 else: 85 form_fields = grok.AutoFields(IUGApplicant).omit( 86 'locked', 'course_admitted', 'password') 91 form_fields = grok.AutoFields(IUGApplicant) 92 for field in UG_OMIT_DISPLAY_FIELDS: 93 form_fields = form_fields.omit(field) 87 94 return form_fields 88 95 … … 96 103 if target is not None and target.startswith('pg'): 97 104 form_fields = grok.AutoFields(IPGApplicant) 105 for field in PG_OMIT_MANAGE_FIELDS: 106 form_fields = form_fields.omit(field) 98 107 else: 99 108 form_fields = grok.AutoFields(IUGApplicant) 109 for field in UG_OMIT_MANAGE_FIELDS: 110 form_fields = form_fields.omit(field) 100 111 form_fields['student_id'].for_display = True 101 112 form_fields['applicant_id'].for_display = True … … 110 121 target = getattr(self.context.__parent__, 'prefix', None) 111 122 if target is not None and target.startswith('pg'): 112 form_fields = grok.AutoFields(IPGApplicantEdit).omit( 113 'locked', 'course_admitted', 'student_id', 114 'screening_score', 'screening_venue' 115 ) 123 form_fields = grok.AutoFields(IPGApplicantEdit) 124 for field in PG_OMIT_EDIT_FIELDS: 125 form_fields = form_fields.omit(field) 116 126 else: 117 form_fields = grok.AutoFields(IUGApplicantEdit).omit( 118 'locked', 'course_admitted', 'student_id', 119 'screening_score' 120 ) 127 form_fields = grok.AutoFields(IUGApplicantEdit) 128 for field in UG_OMIT_EDIT_FIELDS: 129 form_fields = form_fields.omit(field) 121 130 form_fields['applicant_id'].for_display = True 122 131 form_fields['reg_number'].for_display = True -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
r8502 r8519 32 32 from waeup.uniben.payments.interfaces import ICustomOnlinePayment 33 33 34 UG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 'password') 35 UG_OMIT_MANAGE_FIELDS = () 36 UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + ('locked', 'course_admitted', 37 'student_id', 'screening_score', 'screening_venue') 38 39 PG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 'password') 40 PG_OMIT_MANAGE_FIELDS = () 41 PG_OMIT_EDIT_FIELDS = PG_OMIT_MANAGE_FIELDS + ('locked', 'course_admitted', 42 'student_id', 'screening_score', 'screening_venue') 43 34 44 class IUGApplicant(IApplicantBaseData): 35 45 """An undergraduate applicant. 36 46 47 This interface defines the least common multiple of all fields 48 in ug application forms. In customized forms, fields can be excluded by 49 adding them to the UG_OMIT* tuples. 37 50 """ 38 51 … … 58 71 """A postgraduate applicant. 59 72 73 This interface defines the least common multiple of all fields 74 in pg application forms. In customized forms, fields can be excluded by 75 adding them to the PG_OMIT* tuples. 60 76 """ 61 77 -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests.py
r8196 r8519 123 123 self.browser.open(pgapplicant_path + '/application_slip.pdf') 124 124 self.assertEqual(self.browser.headers['Status'], '200 Ok') 125 # If we lool atthe applicant in the ug container,125 # If we view the applicant in the ug container, 126 126 # the employer field doesn't appear 127 127 ugapplicant_path = ('http://localhost/app/applicants/app2011/%s'
Note: See TracChangeset for help on using the changeset viewer.