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

Last change on this file since 15970 was 15889, checked in by Henrik Bettermann, 5 years ago

Make topMargin customizable.

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