- Timestamp:
- 6 May 2022, 07:19:00 (3 years ago)
- Location:
- main/kofacustom.unidel/trunk/src/kofacustom/unidel/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/batching.py
r16721 r16949 19 19 """ 20 20 from kofacustom.nigeria.students.batching import NigeriaStudentProcessor 21 from waeup.kofa.students.batching import StudentOnlinePaymentProcessor 21 from waeup.kofa.students.batching import ( 22 StudentOnlinePaymentProcessor, StudentStudyLevelProcessor) 22 23 from kofacustom.unidel.students.interfaces import ( 23 24 ICustomStudent, 24 25 ICustomStudentUpdateByRegNo, 25 26 ICustomStudentUpdateByMatricNo, 26 ICustomStudentOnlinePayment 27 ICustomStudentOnlinePayment, 28 ICustomStudentStudyLevel 27 29 ) 28 30 … … 38 40 """ 39 41 iface = ICustomStudentOnlinePayment 42 43 class CustomStudentStudyLevelProcessor(StudentStudyLevelProcessor): 44 """ 45 """ 46 iface = ICustomStudentStudyLevel 47 48 @property 49 def available_fields(self): 50 fields = super( 51 CustomStudentStudyLevelProcessor, self).available_fields + ['previous',] 52 fields.remove('total_credits_s1') 53 fields.remove('total_credits_s2') 54 return fields -
main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/browser.py
r16888 r16949 27 27 from waeup.kofa.browser.layout import action, jsaction 28 28 from waeup.kofa.students.browser import ( 29 StudyLevelEditFormPage, StudyLevelDisplayFormPage, 29 StudyLevelEditFormPage, StudyLevelDisplayFormPage, StudyLevelManageFormPage, 30 30 StudentBasePDFFormPage, ExportPDFCourseRegistrationSlip, 31 31 CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage, … … 113 113 form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 114 114 115 class CustomStudyLevelDisplayFormPage(StudyLevelDisplayFormPage): 116 """ Page to display student study levels 117 """ 118 #grok.template('studylevelpage') 119 grok.context(ICustomStudentStudyLevel) 120 121 form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit( 122 'level',) 123 form_fields[ 124 'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 125 126 class CustomStudyLevelManageFormPage(StudyLevelManageFormPage): 127 """ Page to edit the student study level data 128 """ 129 grok.context(ICustomStudentStudyLevel) 130 131 form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit( 132 'validation_date', 'validated_by', 'total_credits', 'gpa', 'level', 133 'total_credits_s1', 'total_credits_s2') 134 135 class CustomExportPDFCourseRegistrationSlip(ExportPDFCourseRegistrationSlip): 136 """Deliver a PDF slip of the context. 137 """ 138 grok.context(ICustomStudentStudyLevel) 139 form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit( 140 'level', 'gpa', 'transcript_remark') 141 form_fields[ 142 'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 143 #prefix = 'form' 144 omit_fields = ( 145 'password', 'suspended', 'phone', 'date_of_birth', 146 'adm_code', 'sex', 'suspended_comment', 'current_level', 147 'flash_notice') -
main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/interfaces.py
r16721 r16949 65 65 """ 66 66 67 total_credits_s1 = schema.Int( 68 title = _(u'1st Semester Credits'), 69 required = False, 70 ) 71 72 total_credits_s2 = schema.Int( 73 title = _(u'2nd Semester Credits'), 74 required = False, 75 ) 76 77 total_credits = schema.Int( 78 title = _(u'Total Credits'), 79 required = False, 80 ) 81 67 82 class ICustomStudentOnlinePayment(ICustomOnlinePayment): 68 83 """A student payment via payment gateways. -
main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/studylevel.py
r16721 r16949 38 38 grok.provides(ICustomStudentStudyLevel) 39 39 40 @property 41 def total_credits_s1(self): 42 total = 0 43 for ticket in self.values(): 44 if ticket.semester == 1 and not ticket.outstanding: 45 total += ticket.credits 46 return total 47 48 @property 49 def total_credits_s2(self): 50 total = 0 51 for ticket in self.values(): 52 if ticket.semester == 2 and not ticket.outstanding: 53 total += ticket.credits 54 return total 55 40 56 CustomStudentStudyLevel = attrs_to_fields( 41 CustomStudentStudyLevel, omit=['total_credits', 'gpa']) 57 CustomStudentStudyLevel, omit=['total_credits', 'gpa', 58 'total_credits_s1', 'total_credits_s2']) 42 59 43 60 class CustomStudentStudyLevelFactory(StudentStudyLevelFactory):
Note: See TracChangeset for help on using the changeset viewer.