Changeset 8865 for main/waeup.uniben


Ignore:
Timestamp:
1 Jul 2012, 17:16:25 (12 years ago)
Author:
Henrik Bettermann
Message:

Derive payments and students interfaces from interface classes in kofacustom.nigeria.

Location:
main/waeup.uniben/trunk/src/waeup/uniben
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/payments/interfaces.py

    r8821 r8865  
    1818from zope.interface import Attribute
    1919from zope import schema
    20 from waeup.kofa.payments.interfaces import IPayment
     20from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment
    2121from waeup.uniben.interfaces import MessageFactory as _
    2222
    23 class ICustomOnlinePayment(IPayment):
     23class ICustomOnlinePayment(INigeriaOnlinePayment):
    2424    """A payment via payment gateways.
    2525
    2626    """
    2727
    28     ac = schema.TextLine(
    29         title = _(u'Activation Code'),
    30         default = None,
    31         required = False,
    32         readonly = False,
    33         )
    34 
    35     r_amount_approved = schema.Float(
    36         title = _(u'Response Amount Approved'),
    37         default = 0.0,
    38         required = False,
    39         readonly = False,
    40         )
    41 
    42     r_code = schema.TextLine(
    43         title = _(u'Response Code'),
    44         default = None,
    45         required = False,
    46         readonly = False,
    47         )
    48 
    49     r_desc = schema.TextLine(
    50         title = _(u'Response Description'),
    51         default = None,
    52         required = False,
    53         readonly = False,
    54         )
    55 
    56     # Only defined in custom package
    57 
    58     r_pay_reference = schema.TextLine(
    59         title = _(u'Response Payment Reference'),
    60         default = None,
    61         required = False,
    62         readonly = False,
    63         )
    64 
    65     r_card_num = schema.TextLine(
    66         title = _(u'Response Card Number'),
    67         default = None,
    68         required = False,
    69         readonly = False,
    70         )
  • main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py

    r8821 r8865  
    1616## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    1717##
    18 from zope import schema
    19 from waeup.kofa.schema import TextLineChoice
    20 from waeup.kofa.interfaces import SimpleKofaVocabulary, academic_sessions_vocab
    21 from waeup.kofa.schema import FormattedDate
    22 from waeup.kofa.schoolgrades import ResultEntryField
    23 from waeup.kofa.students.vocabularies import nats_vocab
    24 from waeup.kofa.students.interfaces import (
    25     IStudentBase, IUGStudentClearance, IPGStudentClearance,
    26     IStudentPersonal, IStudentNavigation, IStudentStudyLevel,
    27     IStudentStudyCourse, ICourseTicket
     18
     19from kofacustom.nigeria.students.interfaces import (
     20    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
     21    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
     22    INigeriaStudentStudyCourse, INigeriaCourseTicket,
     23    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
     24    INigeriaStudentOnlinePayment
    2825    )
    29 from waeup.kofa.students.vocabularies import (
    30     nats_vocab, contextual_reg_num_source)
    31 from kofacustom.nigeria.interfaces import (
    32     high_qual, high_grade, exam_types, LGASource)
    33 from waeup.uniben.interfaces import MessageFactory as _
    34 from waeup.uniben.payments.interfaces import ICustomOnlinePayment
    3526
    36 
    37 class ICustomStudentBase(IStudentBase):
     27class ICustomStudentBase(INigeriaStudentBase):
    3828    """Representation of student base data.
    3929
    4030    """
    4131
    42     reg_number = TextLineChoice(
    43         title = _(u'Registration Number'),
    44         required = False,
    45         readonly = False,
    46         source = contextual_reg_num_source,
    47         )
    48 
    49 class ICustomStudentPersonal(IStudentPersonal):
     32class ICustomStudentPersonal(INigeriaStudentPersonal):
    5033    """Student personal data.
    5134
    5235    """
    5336
    54     marit_stat = schema.Choice(
    55         title = u'Maritual Status',
    56         default = 'unmarried',
    57         required = False,
    58         vocabulary = SimpleKofaVocabulary(
    59             (_('Unmarried'), 'unmarried'),
    60             (_('Married'), 'married'),)
    61         )
    62 
    63 class ICustomUGStudentClearance(IUGStudentClearance):
     37class ICustomUGStudentClearance(INigeriaUGStudentClearance):
    6438    """Representation of ug student clearance data.
    6539
    6640    """
    67     date_of_birth = FormattedDate(
    68         title = _(u'Date of Birth'),
    69         required = False,
    70         show_year = True,
    71         )
    7241
    73     nationality = schema.Choice(
    74         source = nats_vocab,
    75         title = _(u'Nationality'),
    76         required = False,
    77         )
    78 
    79     lga = schema.Choice(
    80         source = LGASource(),
    81         title = _(u'State/LGA (Nigerians only)'),
    82         required = False,
    83         )
    84 
    85     def_adm = schema.Bool(
    86         title = _(u'Deferent of Admission'),
    87         required = False,
    88         readonly = False,
    89         )
    90 
    91     fst_sit_fname = schema.TextLine(
    92         title = _(u'Full Name'),
    93         required = False,
    94         readonly = False,
    95         )
    96     fst_sit_no = schema.TextLine(
    97         title = _(u'Exam Number'),
    98         required = False,
    99         readonly = False,
    100         )
    101 
    102     fst_sit_date = FormattedDate(
    103         title = _(u'Exam Date'),
    104         required = False,
    105         readonly = False,
    106         show_year = True,
    107         )
    108 
    109     fst_sit_type = schema.Choice(
    110         title = _(u'Exam Type'),
    111         required = False,
    112         readonly = False,
    113         vocabulary = exam_types,
    114         )
    115 
    116     fst_sit_results = schema.List(
    117         title = _(u'Exam Results'),
    118         value_type = ResultEntryField(),
    119         required = False,
    120         readonly = False,
    121         default = [],
    122         )
    123 
    124     scd_sit_fname = schema.TextLine(
    125         title = _(u'Full Name'),
    126         required = False,
    127         readonly = False,
    128         )
    129     scd_sit_no = schema.TextLine(
    130         title = _(u'Exam Number'),
    131         required = False,
    132         readonly = False,
    133         )
    134 
    135     scd_sit_date = FormattedDate(
    136         title = _(u'Exam Date'),
    137         required = False,
    138         readonly = False,
    139         show_year = True,
    140         )
    141 
    142     scd_sit_type = schema.Choice(
    143         title = _(u'Exam Type'),
    144         required = False,
    145         readonly = False,
    146         vocabulary = exam_types,
    147         )
    148 
    149     scd_sit_results = schema.List(
    150         title = _(u'Exam Results'),
    151         value_type = ResultEntryField(),
    152         required = False,
    153         readonly = False,
    154         default = [],
    155         )
    156 
    157     alr_fname = schema.TextLine(
    158         title = _(u'Full Name'),
    159         required = False,
    160         readonly = False,
    161         )
    162     alr_no = schema.TextLine(
    163         title = _(u'Exam Number'),
    164         required = False,
    165         readonly = False,
    166         )
    167 
    168     alr_date = FormattedDate(
    169         title = _(u'Exam Date'),
    170         required = False,
    171         readonly = False,
    172         show_year = True,
    173         )
    174 
    175     alr_results = schema.List(
    176         title = _(u'Exam Results'),
    177         value_type = ResultEntryField(),
    178         required = False,
    179         readonly = False,
    180         default = [],
    181         )
    182 
    183     hq_type = schema.Choice(
    184         title = _(u'Qualification Obtained'),
    185         required = False,
    186         readonly = False,
    187         vocabulary = high_qual,
    188         )
    189 
    190     hq_matric_no = schema.TextLine(
    191         title = _(u'Former Matric Number'),
    192         required = False,
    193         readonly = False,
    194         )
    195 
    196     hq_degree = schema.Choice(
    197         title = _(u'Class of Degree'),
    198         required = False,
    199         readonly = False,
    200         vocabulary = high_grade,
    201         )
    202 
    203     hq_school = schema.TextLine(
    204         title = _(u'Institution Attended'),
    205         required = False,
    206         readonly = False,
    207         )
    208 
    209     hq_session = schema.TextLine(
    210         title = _(u'Years Attended'),
    211         required = False,
    212         readonly = False,
    213         )
    214 
    215     hq_disc = schema.TextLine(
    216         title = _(u'Discipline'),
    217         required = False,
    218         readonly = False,
    219         )
    220 
    221 
    222 class ICustomPGStudentClearance(ICustomUGStudentClearance):
     42class ICustomPGStudentClearance(INigeriaPGStudentClearance):
    22343    """Representation of pg student clearance data.
    22444
    22545    """
    226 
    227     hq2_type = schema.Choice(
    228         title = _(u'Qualification Obtained'),
    229         required = False,
    230         readonly = False,
    231         vocabulary = high_qual,
    232         )
    233 
    234     hq2_matric_no = schema.TextLine(
    235         title = _(u'Former Matric Number'),
    236         required = False,
    237         readonly = False,
    238         )
    239 
    240     hq2_degree = schema.Choice(
    241         title = _(u'Class of Degree'),
    242         required = False,
    243         readonly = False,
    244         vocabulary = high_grade,
    245         )
    246 
    247     hq2_school = schema.TextLine(
    248         title = _(u'Institution Attended'),
    249         required = False,
    250         readonly = False,
    251         )
    252 
    253     hq2_session = schema.TextLine(
    254         title = _(u'Years Attended'),
    255         required = False,
    256         readonly = False,
    257         )
    258 
    259     hq2_disc = schema.TextLine(
    260         title = _(u'Discipline'),
    261         required = False,
    262         readonly = False,
    263         )
    264 
    265     nysc_year = schema.Int(
    266         title = _(u'Nysc Year'),
    267         required = False,
    268         readonly = False,
    269         )
    270 
    271     nysc_lga = schema.Choice(
    272         source = LGASource(),
    273         title = _(u'Nysc Location'),
    274         required = False,
    275         )
    276 
    277     employer = schema.TextLine(
    278         title = _(u'Employer'),
    279         required = False,
    280         readonly = False,
    281         )
    282 
    283     emp_position = schema.TextLine(
    284         title = _(u'Employer Position'),
    285         required = False,
    286         readonly = False,
    287         )
    288 
    289     emp_start = FormattedDate(
    290         title = _(u'Start Date'),
    291         required = False,
    292         readonly = False,
    293         show_year = True,
    294         )
    295 
    296     emp_end = FormattedDate(
    297         title = _(u'End Date'),
    298         required = False,
    299         readonly = False,
    300         show_year = True,
    301         )
    302 
    303     emp_reason = schema.TextLine(
    304         title = _(u'Reason for Leaving'),
    305         required = False,
    306         readonly = False,
    307         )
    308 
    309     employer2 = schema.TextLine(
    310         title = _(u'2nd Employer'),
    311         required = False,
    312         readonly = False,
    313         )
    314 
    315     emp2_position = schema.TextLine(
    316         title = _(u'2nd Employer Position'),
    317         required = False,
    318         readonly = False,
    319         )
    320 
    321     emp2_start = FormattedDate(
    322         title = _(u'Start Date'),
    323         required = False,
    324         readonly = False,
    325         show_year = True,
    326         )
    327     emp2_end = FormattedDate(
    328         title = _(u'End Date'),
    329         required = False,
    330         readonly = False,
    331         show_year = True,
    332         )
    333 
    334     emp2_reason = schema.TextLine(
    335         title = _(u'Reason for Leaving'),
    336         required = False,
    337         readonly = False,
    338         )
    339 
    340     former_matric = schema.TextLine(
    341         title = _(u'If yes, matric number'),
    342         required = False,
    343         readonly = False,
    344         )
    34546
    34647
     
    35152    """
    35253
    353 class ICustomStudentStudyCourse(IStudentStudyCourse):
     54class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
    35455    """A container for student study levels.
    35556
    35657    """
    35758
    358 class ICustomStudentStudyLevel(IStudentStudyLevel):
     59class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
    35960    """A container for course tickets.
    36061
    36162    """
    36263
    363 class ICustomStudentOnlinePayment(ICustomOnlinePayment):
     64class ICustomStudentOnlinePayment(INigeriaStudentOnlinePayment):
    36465    """A student payment via payment gateways.
    36566
    366     This Interface does not inherit from IStudentOnlinePayment.
    367     Thus all fields from IStudentOnlinePayment have to be repeated here.
    36867    """
    36968
    370     p_level = schema.Int(
    371         title = _(u'Payment Level'),
    372         required = False,
    373         readonly = True,
    374         )
    375 
    376 ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
    377     'p_session'].order
    378 
    379 class ICustomCourseTicket(ICourseTicket):
     69class ICustomCourseTicket(INigeriaCourseTicket):
    38070    """A course ticket.
    38171
    38272    """
    38373
    384 class ICustomStudentUpdateByRegNo(ICustomStudent):
     74class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
    38575    """Representation of a student. Skip regular reg_number validation.
    38676
    38777    """
    388     reg_number = schema.TextLine(
    389         title = _(u'Registration Number'),
    390         required = False,
    391         )
    39278
    393 class ICustomStudentUpdateByMatricNo(ICustomStudent):
     79class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
    39480    """Representation of a student. Skip regular matric_number validation.
    39581
    39682    """
    397     matric_number = schema.TextLine(
    398         title = _(u'Matriculation Number'),
    399         required = False,
    400         )
  • main/waeup.uniben/trunk/src/waeup/uniben/students/student.py

    r8204 r8865  
    2323from waeup.kofa.utils.helpers import attrs_to_fields
    2424from waeup.kofa.students.student import Student, StudentFactory
    25 from waeup.uniben.students.interfaces import ICustomStudent, IStudentNavigation
     25from waeup.kofa.students.interfaces import IStudentNavigation
     26from waeup.uniben.students.interfaces import ICustomStudent
    2627
    2728
  • main/waeup.uniben/trunk/src/waeup/uniben/students/studycourse.py

    r8741 r8865  
    2525    StudentStudyCourse, StudentStudyCourseFactory)
    2626from waeup.kofa.utils.helpers import attrs_to_fields
     27from waeup.kofa.students.interfaces import IStudentNavigation
    2728from waeup.kofa.students.workflow import CLEARED, RETURNING, PAID
    28 from waeup.uniben.students.interfaces import (
    29     ICustomStudentStudyCourse, IStudentNavigation)
     29from waeup.uniben.students.interfaces import ICustomStudentStudyCourse
    3030
    3131class CustomStudentStudyCourse(StudentStudyCourse):
  • main/waeup.uniben/trunk/src/waeup/uniben/students/studylevel.py

    r8326 r8865  
    2727    StudentStudyLevel, CourseTicket,
    2828    CourseTicketFactory, StudentStudyLevelFactory)
     29from waeup.kofa.students.interfaces import IStudentNavigation
    2930from waeup.uniben.students.interfaces import (
    30     ICustomStudentStudyLevel, IStudentNavigation, ICustomCourseTicket)
     31    ICustomStudentStudyLevel, ICustomCourseTicket)
    3132
    3233
Note: See TracChangeset for help on using the changeset viewer.