Changeset 12107 for main/kofacustom.nigeria/trunk/src/kofacustom
- Timestamp:
- 1 Dec 2014, 16:13:12 (10 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py
r11536 r12107 154 154 if self.context.is_postgrad: 155 155 form_fields = grok.AutoFields(INigeriaPGStudentClearance).omit( 156 'clearance_locked', 'nysc_location', 'clr_code', 'officer_comment') 156 'clearance_locked', 'nysc_location', 'clr_code', 'officer_comment', 157 'date_of_invitation') 157 158 else: 158 159 form_fields = grok.AutoFields(INigeriaUGStudentClearance).omit( 159 'clearance_locked', 'clr_code', 'officer_comment') 160 'clearance_locked', 'clr_code', 'officer_comment', 161 'date_of_invitation') 160 162 return form_fields 161 163 -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/export.py
r12080 r12107 18 18 """Exporters for student related stuff. 19 19 """ 20 import grok 21 from waeup.kofa.interfaces import REQUESTED 20 22 from kofacustom.nigeria.students.interfaces import ( 21 23 INigeriaStudent, … … 31 33 StudentPaymentsExporter) 32 34 from waeup.kofa.utils.helpers import iface_names 35 from kofacustom.nigeria.interfaces import MessageFactory as _ 33 36 34 37 class NigeriaStudentExporter(StudentExporter): … … 84 87 omit=['display_item']))) + ( 85 88 'student_id','state','current_session') 89 90 class ClearanceRequestedStudentExporter(StudentExporter): 91 """Exporter of data used to assign dates of invitation 92 """ 93 94 grok.name('clearancerequested') 95 96 fields = ('student_id', 'reg_number', 'display_fullname', 97 'state', 'current_session', 'history', 'date_of_invitation') 98 99 title = _(u'Clearance Invitation Data') 100 101 def filter_func(self, x, **kw): 102 # We use this method to post-filter students in state 103 # 'clearance_requested' 104 return [student for student in x if student.state == REQUESTED] 105 106 def mangle_value(self, value, name, context=None): 107 if name == 'history': 108 # Only show last mesage 109 value = value.messages[-1] 110 return super( 111 StudentExporter, self).mangle_value( 112 value, name, context=context) -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/interfaces.py
r10690 r12107 68 68 ) 69 69 70 date_of_invitation= schema.TextLine( 71 title = _(u"Date of Invitation"), 72 required = False, 73 ) 74 70 75 clearance_locked = schema.Bool( 71 76 title = _(u'Clearance form locked'), -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_export.py
r12080 r12107 48 48 self.assertMatches( 49 49 'adm_code,alr_date,alr_fname,alr_no,alr_results,clearance_locked,' 50 'clr_code,date_of_birth,d ef_adm,disabled,email,emp2_end,'50 'clr_code,date_of_birth,date_of_invitation,def_adm,disabled,email,emp2_end,' 51 51 'emp2_position,emp2_reason,emp2_start,emp_end,emp_position,' 52 52 'emp_reason,emp_start,employer,employer2,firstname,former_matric,' … … 63 63 'suspended,suspended_comment,password,state,history,certcode,is_postgrad,' 64 64 'current_level,current_session\r\nmy adm code,,,,' 65 '"[(\'accounts\', \'A\')]",0,my clr code,1981-02-04#,,, '65 '"[(\'accounts\', \'A\')]",0,my clr code,1981-02-04#,,,,' 66 66 'anna@sample.com,,,,,,,,,,,Anna,,,,,"[(\'accounts\', \'A\')]"' 67 67 ',,,,,,,,,,,,,,,,Tester,,,234,M.,NG,,,,,,,,,' -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/utils.py
r10687 r12107 65 65 'form.former_matric': _(u'Former Student'), 66 66 } 67 68 STUDENT_EXPORTER_NAMES = StudentsUtils().STUDENT_EXPORTER_NAMES + ( 69 'clearancerequested',)
Note: See TracChangeset for help on using the changeset viewer.