source: main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py @ 14584

Last change on this file since 14584 was 14584, checked in by Henrik Bettermann, 8 years ago

Replace maxCreditsExceeded by warnCreditsOOR.

  • Property svn:keywords set to Id
File size: 27.1 KB
Line 
1## $Id: interfaces.py 14584 2017-02-24 06:53:41Z henrik $
2##
3## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18#from datetime import datetime
19from zope.component import getUtility
20from zope.interface import Attribute, Interface
21from zope import schema
22from zc.sourcefactory.contextual import BasicContextualSourceFactory
23from waeup.kofa.browser.interfaces import IStudentNavigationBase
24from waeup.kofa.interfaces import (
25    IKofaObject, academic_sessions_vocab, validate_email, ICSVExporter,
26    ContextualDictSourceFactoryBase, IKofaUtils)
27from waeup.kofa.interfaces import MessageFactory as _
28from waeup.kofa.schema import TextLineChoice, FormattedDate, PhoneNumber
29from waeup.kofa.students.vocabularies import (
30    StudyLevelSource, contextual_reg_num_source, contextual_mat_num_source,
31    GenderSource, nats_vocab
32    )
33from waeup.kofa.payments.interfaces import (
34    IPaymentsContainer, IOnlinePayment)
35from waeup.kofa.university.vocabularies import (
36    CourseSource, StudyModeSource, CertificateSource, SemesterSource,
37    )
38
39class PreviousPaymentCategorySource(ContextualDictSourceFactoryBase):
40    """A source that delivers all selectable categories of previous session
41    payments.
42    """
43    #: name of dict to deliver from kofa utils.
44    DICT_NAME = 'PREVIOUS_PAYMENT_CATEGORIES'
45
46class BalancePaymentCategorySource(ContextualDictSourceFactoryBase):
47    """A source that delivers all selectable items of balance payments.
48    """
49    #: name of dict to deliver from kofa utils.
50    DICT_NAME = 'BALANCE_PAYMENT_CATEGORIES'
51
52# VerdictSource can't be placed into the vocabularies module because it
53# requires importing IStudentsUtils which then leads to circular imports.
54class VerdictSource(BasicContextualSourceFactory):
55    """A verdicts source delivers all verdicts provided
56    in the portal.
57    """
58    def getValues(self, context):
59        verdicts_dict = getUtility(IKofaUtils).VERDICTS_DICT
60        return sorted(verdicts_dict.keys())
61
62    def getToken(self, context, value):
63        return value
64
65    def getTitle(self, context, value):
66        verdicts_dict = getUtility(IKofaUtils).VERDICTS_DICT
67        if value != '0':
68            return verdicts_dict[value] + ' (%s)' % value
69        return verdicts_dict[value]
70
71
72class IStudentsUtils(Interface):
73    """A collection of methods which are subject to customization.
74    """
75    def setReturningData(student):
76        """ This method defines what happens after school fee payment
77        depending on the student's senate verdict.
78
79        In the base configuration current level is always increased
80        by 100 no matter which verdict has been assigned.
81        """
82
83    def setPaymentDetails(category, student, previous_session=None,
84            previous_level=None,):
85        """Create Payment object and set the payment data of a student for
86        the payment category specified.
87        """
88
89    def increaseMatricInteger(student):
90        """Increase counter for matric numbers.
91
92        This counter can be a centrally stored attribute or an attribute of
93        faculties, departments or certificates. In the base package the counter
94        is as an attribute of the site configuration object.
95        """
96
97    def constructMatricNumber(student):
98        """Fetch the matric number counter which fits the student and
99        construct the new matric number of the student.
100
101        In the base package the counter is returned which is as an attribute
102        of the site configuration object.
103        """
104
105    def setMatricNumber(student):
106        """Set matriculation number of student.
107
108        If the student's matric number is unset a new matric number is
109        constructed according to the matriculation number construction rules
110        defined in the constructMatricNumber method. The new matric number is
111        set, the students catalog updated. The corresponding matric number
112        counter is increased by one.
113
114        This method is tested but not used in the base package. It can
115        be used in custom packages by adding respective views
116        and by customizing increaseMatricInteger and constructMatricNumber
117        according to the university's matriculation number construction rules.
118
119        The method can be disabled by setting the counter to zero.
120        """
121
122    def getAccommodation_details(student):
123        """Determine the accommodation dates of a student.
124        """
125
126    def selectBed(available_beds):
127        """Select a bed from a list of available beds.
128        In the standard configuration we select the first bed found,
129        but can also randomize the selection if we like.
130        """
131
132    def getPDFCreator(context):
133        """Get some IPDFCreator instance suitable for use with `context`.
134        """
135
136    def renderPDF(view, subject='', filename='slip.pdf',):
137        """Render pdf slips for various pages.
138        """
139
140    def getDegreeClassNumber(level_obj):
141        """Get degree class number (used for SessionResultsPresentation
142        reports).
143        """
144
145    def renderPDFTranscript(view, filename, student,
146                  studentview, note, signatures, sigs_in_footer,
147                  show_scans, topMargin, omit_fields,
148                  tableheader, no_passport):
149        """Render pdf slip of a transcripts.
150        """
151
152    def renderPDFCourseticketsOverview(view, session, data, lecturers):
153        """Render pdf slip of course tickets for a lecturer.
154        """
155
156    def warnCreditsOOR(studylevel, course=None):
157        """Return message if credits are out of range. In the base
158        package only maximum credits is set.
159        """
160
161    def getBedCoordinates(bedticket):
162        """Return descriptive bed coordinates.
163        This method can be used to customize the `display_coordinates`
164        property method in order to  display a
165        customary description of the bed space.
166        """
167
168    def clearance_disabled_message(student):
169        """Render message if clearance is disabled.
170        """
171
172class IStudentsContainer(IKofaObject):
173    """A students container contains university students.
174    """
175    def addStudent(student):
176        """Add an IStudent object and subcontainers.
177        """
178
179    unique_student_id = Attribute('A unique student id')
180
181class IStudentNavigation(IStudentNavigationBase):
182    """Interface needed for navigation and logging. This interface is
183    implemented by all content classes in the students section.
184    """
185    student = Attribute('Student object of context')
186
187    def writeLogMessage(view, message):
188        """Add an INFO message to students.log.
189        """
190
191class IStudentBase(IKofaObject):
192    """Representation of student base data.
193    """
194    history = Attribute('Object history, a list of messages')
195    state = Attribute('Registration state')
196    translated_state = Attribute('Real name of the registration state')
197    certcode = Attribute('Certificate code of any chosen study course')
198    depcode = Attribute('Department code of any chosen study course')
199    faccode = Attribute('Faculty code of any chosen study course')
200    entry_session = Attribute('Entry session')
201    current_session = Attribute('Current session')
202    current_level = Attribute('Current level')
203    current_mode = Attribute('Current mode')
204    current_verdict = Attribute('Current verdict')
205    fullname = Attribute('All name parts separated by hyphens')
206    display_fullname = Attribute('Fullname as displayed on pages')
207    is_postgrad = Attribute('True if postgraduate student')
208    is_special_postgrad = Attribute('True if special postgraduate student')
209    is_fresh = Attribute('True if fresh student')
210    before_payment = Attribute('True if no previous payment has to be made')
211    personal_data_expired = Attribute('True if personal data expired')
212    transcript_enabled = Attribute('True if transcript processing is enabled')
213    clearance_locked = Attribute('True if clearance form is locked')
214
215    password = Attribute('Encrypted password')
216    temp_password = Attribute('Dictionary with user name, timestamp and encrypted password')
217
218    suspended = schema.Bool(
219        title = _(u'Account suspended'),
220        default = False,
221        required = False,
222        )
223
224    suspended_comment = schema.Text(
225        title = _(u"Reasons for Deactivation"),
226        required = False,
227        description = _(
228            u'This message will be shown if and only if deactivated '
229            'students try to login.'),
230        )
231
232    flash_notice = schema.TextLine(
233        title = _(u'Flash Notice'),
234        required = False,
235        readonly = False,
236        description = _(
237            u'This single-line message will be shown in a flash box.'),
238        )
239
240    student_id = schema.TextLine(
241        title = _(u'Student Id'),
242        required = False,
243        )
244
245    firstname = schema.TextLine(
246        title = _(u'First Name'),
247        required = True,
248        )
249
250    middlename = schema.TextLine(
251        title = _(u'Middle Name'),
252        required = False,
253        )
254
255    lastname = schema.TextLine(
256        title = _(u'Last Name (Surname)'),
257        required = True,
258        )
259
260    sex = schema.Choice(
261        title = _(u'Sex'),
262        source = GenderSource(),
263        required = True,
264        )
265
266    reg_number = TextLineChoice(
267        title = _(u'Registration Number'),
268        required = True,
269        readonly = False,
270        source = contextual_reg_num_source,
271        )
272
273    matric_number = TextLineChoice(
274        title = _(u'Matriculation Number'),
275        required = False,
276        readonly = False,
277        source = contextual_mat_num_source,
278        )
279
280    adm_code = schema.TextLine(
281        title = _(u'PWD Activation Code'),
282        required = False,
283        readonly = False,
284        )
285
286    email = schema.ASCIILine(
287        title = _(u'Email'),
288        required = False,
289        constraint=validate_email,
290        )
291    phone = PhoneNumber(
292        title = _(u'Phone'),
293        required = False,
294        )
295
296    def setTempPassword(user, password):
297        """Set a temporary password (LDAP-compatible) SSHA encoded for
298        officers.
299        """
300
301    def getTempPassword():
302        """Check if a temporary password has been set and if it
303        is not expired. Return the temporary password if valid,
304        None otherwise. Unset the temporary password if expired.
305        """
306
307    def transfer(certificate, current_session,
308        current_level, current_verdict):
309        """ Creates a new studycourse and backups the old one.
310        """
311
312    def revert_transfer():
313        """ Revert previous transfer.
314        """
315
316class IUGStudentClearance(IKofaObject):
317    """Representation of undergraduate student clearance data.
318    """
319    officer_comment = schema.Text(
320        title = _(u"Officer's Comment"),
321        required = False,
322        )
323
324    clr_code = schema.TextLine(
325        title = _(u'CLR Activation Code'),
326        required = False,
327        readonly = False,
328        )
329
330    date_of_birth = FormattedDate(
331        title = _(u'Date of Birth'),
332        required = True,
333        show_year = True,
334        )
335
336    nationality = schema.Choice(
337        vocabulary = nats_vocab,
338        title = _(u'Nationality'),
339        required = False,
340        )
341
342class IPGStudentClearance(IUGStudentClearance):
343    """Representation of postgraduate student clearance data.
344    """
345    employer = schema.TextLine(
346        title = _(u'Employer'),
347        required = False,
348        readonly = False,
349        )
350
351class IStudentPersonal(IKofaObject):
352    """Representation of student personal data.
353    """
354    personal_updated = schema.Datetime(
355        title = _(u'Updated'),
356        required = False,
357        readonly = False,
358        )
359
360    perm_address = schema.Text(
361        title = _(u'Permanent Address'),
362        required = False,
363        )
364
365class IStudentTranscript(IKofaObject):
366    """Representation of student transcript data.
367    """
368
369    transcript_comment = schema.Text(
370        title = _(u'Comment'),
371        required = False,
372        )
373
374
375class IStudent(IStudentBase,IUGStudentClearance,IPGStudentClearance,
376    IStudentPersonal, IStudentTranscript):
377    """Representation of a student.
378    """
379
380class IStudentPersonalEdit(IStudentPersonal):
381    """Interface for editing personal data by students.
382    Here we can repeat the fields from IStudentPersonal and set the
383    `required` if necessary.
384    """
385
386    perm_address = schema.Text(
387        title = _(u'Permanent Address'),
388        required = True,
389        )
390
391class IStudentUpdateByRegNo(IStudent):
392    """Representation of a student. Skip regular reg_number validation.
393    """
394    reg_number = schema.TextLine(
395        title = _(u'Registration Number'),
396        required = False,
397        )
398
399class IStudentUpdateByMatricNo(IStudent):
400    """Representation of a student. Skip regular matric_number validation.
401    """
402    matric_number = schema.TextLine(
403        title = _(u'Matriculation Number'),
404        required = False,
405        )
406
407class IStudentRequestPW(IStudent):
408    """Representation of a student for first-time password request.
409    This interface is used when students use the requestpw page to
410    login for the the first time.
411    """
412    number = schema.TextLine(
413        title = _(u'Registr. or Matric. Number'),
414        required = True,
415        )
416
417    firstname = schema.TextLine(
418        title = _(u'First Name'),
419        required = True,
420        )
421
422    email = schema.ASCIILine(
423        title = _(u'Email Address'),
424        required = True,
425        constraint=validate_email,
426        )
427
428class IStudentStudyCourse(IKofaObject):
429    """Representation of student study course data.
430    """
431    next_session_allowed = Attribute('True if the student can proceed to next session')
432    is_postgrad = Attribute('True if student is postgraduate student')
433    is_current = Attribute('True if the study course is the current course of studies')
434    is_previous = Attribute('True if the study course is the previous course of studies')
435
436    certificate = schema.Choice(
437        title = _(u'Certificate'),
438        source = CertificateSource(),
439        required = False,
440        )
441
442    entry_mode = schema.Choice(
443        title = _(u'Entry Mode'),
444        source = StudyModeSource(),
445        required = True,
446        readonly = False,
447        )
448
449    entry_session = schema.Choice(
450        title = _(u'Entry Session'),
451        source = academic_sessions_vocab,
452        #default = datetime.now().year,
453        required = True,
454        readonly = False,
455        )
456
457    current_session = schema.Choice(
458        title = _(u'Current Session'),
459        source = academic_sessions_vocab,
460        required = True,
461        readonly = False,
462        )
463
464    current_level = schema.Choice(
465        title = _(u'Current Level'),
466        source = StudyLevelSource(),
467        required = False,
468        readonly = False,
469        )
470
471    current_verdict = schema.Choice(
472        title = _(u'Current Verdict'),
473        source = VerdictSource(),
474        default = '0',
475        required = False,
476        )
477
478    previous_verdict = schema.Choice(
479        title = _(u'Previous Verdict'),
480        source = VerdictSource(),
481        default = '0',
482        required = False,
483        )
484
485    def addStudentStudyLevel(cert, studylevel):
486        """Add a study level object.
487        """
488
489    def getTranscriptData():
490        """Get a sorted list of dicts with level and course ticket data.
491        This method is used for transcripts.
492        """
493
494class IStudentStudyCourseTransfer(IStudentStudyCourse):
495    """An interface used for student transfers.
496    """
497    certificate = schema.Choice(
498        title = _(u'Certificate'),
499        source = CertificateSource(),
500        required = True,
501        )
502
503    current_level = schema.Choice(
504        title = _(u'Current Level'),
505        source = StudyLevelSource(),
506        required = True,
507        readonly = False,
508        )
509
510    entry_session = schema.Choice(
511        title = _(u'Entry Session'),
512        source = academic_sessions_vocab,
513        #default = datetime.now().year,
514        required = False,
515        readonly = False,
516        )
517
518
519IStudentStudyCourseTransfer['certificate'].order = IStudentStudyCourse[
520    'certificate'].order
521IStudentStudyCourseTransfer['current_level'].order = IStudentStudyCourse[
522    'current_level'].order
523
524class IStudentStudyCourseTranscript(IKofaObject):
525    """An interface for student transcripts.
526    """
527    entry_mode = schema.Choice(
528        title = _(u'Entry Mode'),
529        source = StudyModeSource(),
530        required = True,
531        readonly = False,
532        )
533
534    entry_session = schema.Choice(
535        title = _(u'Entry Session'),
536        source = academic_sessions_vocab,
537        #default = datetime.now().year,
538        required = True,
539        readonly = False,
540        )
541
542class IStudentVerdictUpdate(IKofaObject):
543    """A interface for verdict imports.
544    """
545    current_verdict = schema.Choice(
546        title = _(u'Current Verdict'),
547        source = VerdictSource(),
548        required = True,
549        )
550
551    current_session = schema.Choice(
552        title = _(u'Current Session'),
553        source = academic_sessions_vocab,
554        required = True,
555        )
556
557    current_level = schema.Choice(
558        title = _(u'Current Level'),
559        source = StudyLevelSource(),
560        required = True,
561        )
562
563    bypass_validation = schema.Bool(
564        title = _(u'Bypass validation'),
565        required = False,
566        )
567
568    validated_by = schema.TextLine(
569        title = _(u'Validated by'),
570        required = False,
571        )
572
573class IStudentStudyLevel(IKofaObject):
574    """A representation of student study level data.
575    """
576    certcode = Attribute('The certificate code of the study course')
577    is_current_level = Attribute('True if level is current level of the student')
578    level_title = Attribute('Level title from source')
579    getSessionString = Attribute('Session title from source')
580    number_of_tickets = Attribute('Number of tickets contained in this level')
581    passed_params = Attribute('Information about passed and failed courses')
582    gpa_params_rectified = Attribute('Corrected sessional GPA parameters')
583    gpa_params = Attribute('GPA parameters for this level.')
584    cumulative_params = Attribute(
585        'Cumulative GPA and other cumulative parameters for this level')
586    course_registration_forbidden = Attribute(
587        'Return error message if course registration is forbidden')
588
589    level = schema.Choice(
590        title = _(u'Level'),
591        source = StudyLevelSource(),
592        required = True,
593        readonly = False,
594        )
595
596    level_session = schema.Choice(
597        title = _(u'Session'),
598        source = academic_sessions_vocab,
599        required = True,
600        )
601
602    level_verdict = schema.Choice(
603        title = _(u'Verdict'),
604        source = VerdictSource(),
605        default = '0',
606        required = False,
607        )
608
609    validated_by = schema.TextLine(
610        title = _(u'Validated by'),
611        default = None,
612        required = False,
613        )
614
615    validation_date = schema.Datetime(
616        title = _(u'Validation Date'),
617        required = False,
618        readonly = False,
619        )
620
621    total_credits = schema.Int(
622        title = _(u'Total Credits'),
623        required = False,
624        readonly = True,
625        )
626
627    gpa = schema.TextLine(
628        title = _(u'Unrectified GPA'),
629        required = False,
630        readonly = True,
631        )
632
633    def addCourseTicket(ticket, course):
634        """Add a course ticket object.
635        """
636
637    def addCertCourseTickets(cert):
638        """Collect all certificate courses and create course
639        tickets automatically.
640        """
641
642class ICourseTicket(IKofaObject):
643    """A representation of course ticket data.
644    """
645    certcode = Attribute('Certificate code of the study course')
646    level_session = Attribute('Session of the study level the ticket has been added to')
647    level = Attribute('Level value of the study level the ticket has been added to')
648    total_score = Attribute('Score')
649    grade = Attribute('Grade calculated from total score')
650    weight = Attribute('Weight calculated from total score')
651    removable_by_student = Attribute('True if student is allowed to remove the ticket')
652    editable_by_lecturer = Attribute('True if lecturer is allowed to edit the ticket')
653
654    code = Attribute('Code of the original course')
655
656    title = schema.TextLine(
657        title = _(u'Title'),
658        required = False,
659        )
660
661    fcode = schema.TextLine(
662        title = _(u'Faculty Code'),
663        required = False,
664        )
665
666    dcode = schema.TextLine(
667        title = _(u'Department Code'),
668        required = False,
669        )
670
671    semester = schema.Choice(
672        title = _(u'Semester/Term'),
673        source = SemesterSource(),
674        required = False,
675        )
676
677    passmark = schema.Int(
678        title = _(u'Passmark'),
679        required = False,
680        )
681
682    credits = schema.Int(
683        title = _(u'Credits'),
684        required = False,
685        )
686
687    mandatory = schema.Bool(
688        title = _(u'Required'),
689        default = False,
690        required = False,
691        )
692
693    outstanding = schema.Bool(
694        title = _(u'Outstanding Course'),
695        default = False,
696        required = False,
697        )
698
699    score = schema.Int(
700        title = _(u'Score'),
701        default = None,
702        required = False,
703        missing_value = None,
704        )
705
706    carry_over = schema.Bool(
707        title = _(u'Carry-over Course'),
708        default = False,
709        required = False,
710        )
711
712    automatic = schema.Bool(
713        title = _(u'Automatical Creation'),
714        default = False,
715        required = False,
716        )
717
718class ICourseTicketAdd(IKofaObject):
719    """An interface for adding course tickets.
720    """
721    course = schema.Choice(
722        title = _(u'Course'),
723        source = CourseSource(),
724        readonly = False,
725        )
726
727class ICourseTicketImport(ICourseTicket):
728    """An interface for importing course results and nothing more.
729    """
730    score = schema.Int(
731        title = _(u'Score'),
732        required = False,
733        readonly = False,
734        )
735
736    level_session = schema.Choice(
737        title = _(u'Level Session'),
738        source = academic_sessions_vocab,
739        required = False,
740        readonly = False,
741        )
742
743class IStudentAccommodation(IKofaObject):
744    """A container for student accommodation objects.
745    """
746
747    desired_hostel = schema.TextLine(
748        title = _(u'Desired Hostel'),
749        required = False,
750        )
751
752    def addBedTicket(bedticket):
753        """Add a bed ticket object.
754        """
755
756
757class IBedTicket(IKofaObject):
758    """A representation of accommodation booking data.
759    """
760    bed = Attribute('The bed object')
761    maint_payment_made = Attribute('True if maintenance payment is made')
762
763    display_coordinates = schema.TextLine(
764        title = _(u'Allocated Bed'),
765        required = False,
766        readonly = True,
767        )
768
769    bed_coordinates = schema.TextLine(
770        title = u'',
771        required = True,
772        readonly = False,
773        )
774
775    bed_type = schema.TextLine(
776        title = _(u'Requested Bed Type'),
777        required = True,
778        readonly = False,
779        )
780
781    booking_session = schema.Choice(
782        title = _(u'Session'),
783        source = academic_sessions_vocab,
784        required = True,
785        readonly = False
786        )
787
788    booking_date = schema.Datetime(
789        title = _(u'Booking Date'),
790        required = False,
791        readonly = False,
792        )
793
794    booking_code = schema.TextLine(
795        title = _(u'Booking Activation Code'),
796        required = False,
797        readonly = False,
798        )
799
800    def getSessionString():
801        """Returns the title of academic_sessions_vocab term of the session
802        when the bed was booked.
803        """
804
805class IStudentPaymentsContainer(IPaymentsContainer):
806    """A container for student payment objects.
807    """
808
809    certificate = Attribute('Certificate to determine the correct p_level value')
810
811class IStudentOnlinePayment(IOnlinePayment):
812    """A student payment via payment gateways.
813    """
814
815    certificate = Attribute('Certificate to determine the correct p_level value')
816    student = Attribute('Student')
817
818    p_current = schema.Bool(
819        title = _(u'Current Session Payment'),
820        default = True,
821        required = False,
822        )
823
824    p_level = schema.Choice(
825        title = _(u'Payment Level'),
826        source = StudyLevelSource(),
827        required = False,
828        )
829
830    def redeemTicket():
831        """Either create an appropriate access code or trigger an action
832        directly.
833        """
834
835    def doAfterStudentPayment():
836        """Process student after payment was made.
837        """
838
839    def doAfterStudentPaymentApproval():
840        """Process student after payment was approved.
841        """
842
843    def approveStudentPayment():
844        """Approve payment and process student.
845        """
846
847IStudentOnlinePayment['p_level'].order = IStudentOnlinePayment[
848    'p_session'].order
849
850class IStudentPreviousPayment(IKofaObject):
851    """An interface for adding previous session payments.
852    """
853
854    p_category = schema.Choice(
855        title = _(u'Payment Category'),
856        default = u'schoolfee',
857        source = PreviousPaymentCategorySource(),
858        required = True,
859        )
860
861    p_session = schema.Choice(
862        title = _(u'Payment Session'),
863        source = academic_sessions_vocab,
864        required = True,
865        )
866
867    p_level = schema.Choice(
868        title = _(u'Payment Level'),
869        source = StudyLevelSource(),
870        required = True,
871        )
872
873class IStudentBalancePayment(IKofaObject):
874    """An interface for adding balances.
875    """
876
877    p_category = schema.Choice(
878        title = _(u'Payment Category'),
879        default = u'schoolfee',
880        required = True,
881        source = BalancePaymentCategorySource(),
882        )
883
884    balance_session = schema.Choice(
885        title = _(u'Payment Session'),
886        source = academic_sessions_vocab,
887        required = True,
888        )
889
890    balance_level = schema.Choice(
891        title = _(u'Payment Level'),
892        source = StudyLevelSource(),
893        required = True,
894        )
895
896    balance_amount = schema.Float(
897        title = _(u'Balance Amount'),
898        default = None,
899        required = True,
900        readonly = False,
901        description = _(
902            u'Balance in Naira '),
903        )
904
905class ICSVStudentExporter(ICSVExporter):
906    """A regular ICSVExporter that additionally supports exporting
907      data from a given student object.
908    """
909    def get_filtered(site, **kw):
910        """Get a filtered set of students.
911        """
912
913    def get_selected(site, selected):
914        """Get set of selected students.
915        """
916
917    def export_student(student, filepath=None):
918        """Export data for a given student.
919        """
920
921    def export_filtered(site, filepath=None, **kw):
922        """Export data for filtered set of students.
923        """
924
925    def export_selected(site, filepath=None, **kw):
926        """Export data for selected set of students.
927        """
Note: See TracBrowser for help on using the repository browser.