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

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

Update IStudentsUtils and docs.

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