Changeset 16817
- Timestamp:
- 17 Feb 2022, 09:09:52 (3 years ago)
- Location:
- main/kofacustom.dspg/trunk/src/kofacustom/dspg/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/batching.py
r14716 r16817 27 27 ICustomStudent, ICustomStudentUpdateByRegNo, 28 28 ICustomStudentUpdateByMatricNo, 29 ICustomStudentOnlinePayment 29 ICustomStudentOnlinePayment, 30 ICustomStudentStudyLevel 30 31 ) 31 32 from waeup.kofa.students.batching import ( 32 StudentProcessor, StudentOnlinePaymentProcessor) 33 StudentProcessor, StudentOnlinePaymentProcessor, 34 StudentStudyLevelProcessor) 33 35 34 36 class CustomStudentProcessor(StudentProcessor): … … 43 45 """ 44 46 iface = ICustomStudentOnlinePayment 47 48 class CustomStudentStudyLevelProcessor(StudentStudyLevelProcessor): 49 """ 50 """ 51 iface = ICustomStudentStudyLevel 52 53 @property 54 def available_fields(self): 55 fields = super(CustomStudentStudyLevelProcessor, self).available_fields 56 fields.remove('total_credits_s1') 57 fields.remove('total_credits_s2') 58 return fields -
main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/browser.py
r16155 r16817 26 26 KofaEditFormPage, UtilityView, action, jsaction) 27 27 from waeup.kofa.students.browser import ( 28 StudyLevelEditFormPage, StudyLevelDisplayFormPage, 28 StudyLevelEditFormPage, StudyLevelDisplayFormPage, StudyLevelManageFormPage, 29 29 StudentBasePDFFormPage, ExportPDFCourseRegistrationSlip, 30 30 CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage, … … 80 80 """ 81 81 grok.template('studylevelpage') 82 grok.context(ICustomStudentStudyLevel) 83 form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit( 84 'level',) 85 form_fields[ 86 'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 82 87 83 88 class CustomStudyLevelEditFormPage(StudyLevelEditFormPage): … … 92 97 form_fields = grok.AutoFields(ICourseTicket).omit('score') 93 98 99 class CustomStudyLevelManageFormPage(StudyLevelManageFormPage): 100 """ Page to edit the student study level data 101 """ 102 grok.context(ICustomStudentStudyLevel) 103 104 form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit( 105 'validation_date', 'validated_by', 'total_credits', 'gpa', 'level', 106 'total_credits_s1', 'total_credits_s2') 107 94 108 class CustomExportPDFCourseRegistrationSlip(ExportPDFCourseRegistrationSlip): 95 109 """Deliver a PDF slip of the context. 96 110 """ 111 grok.context(ICustomStudentStudyLevel) 112 form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit( 113 'level', 'gpa', 'transcript_remark') 114 form_fields[ 115 'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 116 prefix = 'form' 117 omit_fields = ( 118 'password', 'suspended', 'phone', 'date_of_birth', 119 'adm_code', 'sex', 'suspended_comment', 'current_level', 120 'flash_notice') 97 121 98 122 def render(self): -
main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/interfaces.py
r14716 r16817 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.dspg/trunk/src/kofacustom/dspg/students/studylevel.py
r15097 r16817 39 39 40 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 56 @property 41 57 def gpa_params(self): 42 58 """Calculate gpa parameters for this level. … … 60 76 61 77 CustomStudentStudyLevel = attrs_to_fields( 62 CustomStudentStudyLevel, omit=['total_credits', 'gpa']) 78 CustomStudentStudyLevel, omit=['total_credits', 'gpa', 79 'total_credits_s1', 'total_credits_s2']) 63 80 64 81 class CustomStudentStudyLevelFactory(StudentStudyLevelFactory):
Note: See TracChangeset for help on using the changeset viewer.