Ignore:
Timestamp:
14 May 2011, 14:19:59 (14 years ago)
Author:
Henrik Bettermann
Message:

Adding some attributes to ApplicantsContainer?. Generate title and code of containers automatically.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py

    r6076 r6087  
    55## $Id$
    66##
    7 ## Copyright (C) 2011 Uli Fouquet
     7## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
    88## This program is free software; you can redistribute it and/or modify
    99## it under the terms of the GNU General Public License as published by
     
    3434from waeup.sirp.image.image import WAeUPImageFile
    3535from waeup.sirp.interfaces import IWAeUPObject, SimpleWAeUPVocabulary
     36from waeup.sirp.university.vocabularies import FutureYearsSource
    3637
    3738
     
    4950    )
    5051
    51 #: Categories of applications we support.
    52 #: Yet not complete nor correct.
    53 APPLICATION_CATEGORIES = (
    54     ('Direct Entry Screening Exam (PDE)', 'pde'),
    55     ('Post-UME', 'pume'),
    56     ('Post-UDE', 'pude'),
    57     ('PCE', 'pce'),
     52#: Types of applications we support.
     53APPLICATION_TYPES = (
     54    ('Pre-NCE Programme', 'prence'),
     55    ('Post UME Screening Test', 'pume'),
     56    ('Post UDE Screening', 'pude'),
     57    ('Part Time Degree in Education', 'sandwich'),
     58    ('Part-Time Degree Programmes', 'pt'),
     59    ('Diploma Programmes', 'dp'),
     60    ('PCE Screening', 'pce'),
     61    ('Certificate Programmes', 'ct'),
    5862    ('Common Entry Screening Test (CEST)', 'cest'),
    5963    )
    6064
    6165#: A :class:`waeup.sirp.interfaces.SimpleWAeUPVocabulary` of supported
    62 #: application categories.
    63 application_categories_vocab = SimpleWAeUPVocabulary(*APPLICATION_CATEGORIES)
     66#: application or screening types.
     67application_types_vocab = SimpleWAeUPVocabulary(*APPLICATION_TYPES)
    6468
    6569class GenderSource(BasicSourceFactory):
     
    152156    code = schema.TextLine(
    153157        title = u'Code',
    154         description = u'Abbreviated code of applicants container',
    155         default = u'NA',
    156         required = True,
    157         readonly = True,
    158         )
     158        default = u'-',
     159        required = True,
     160        readonly = True,
     161        )
     162       
     163    title = schema.TextLine(
     164        title = u'Title',
     165        required = True,
     166        default = u'-',
     167        readonly = True,
     168        )       
     169       
     170    prefix = schema.Choice(
     171        title = u'Application target',
     172        required = True,
     173        default = None,
     174        source = application_types_vocab,
     175        readonly = True,
     176        )
     177
     178    year = schema.Choice(
     179        title = u'Year of entrance',
     180        required = True,
     181        default = None,
     182        source = FutureYearsSource(),
     183        readonly = True,
     184        )               
    159185
    160186    provider = schema.Choice(
     
    163189        default = None,
    164190        source = ApplicantContainerProviderSource(),
    165         )
    166 
    167     title = schema.TextLine(
    168         title = u'Title of the type of applicants stored here',
    169         required = True,
    170         default = u'Untitled',
     191        readonly = True,
    171192        )
    172193
     
    228249    """An applicants container contains university applicants.
    229250    """
    230     code = schema.TextLine(
    231         title = u'Code',
    232         description = u'Abbreviated code of applicants container',
    233         default = u'NA',
    234         required = True,
     251    prefix = schema.Choice(
     252        title = u'Application target',
     253        required = True,
     254        default = None,
     255        source = application_types_vocab,
    235256        readonly = False,
    236257        )
    237258
    238 IApplicantsContainerAdd['code'].order =  IApplicantsContainer['code'].order
     259    year = schema.Choice(
     260        title = u'Year of entrance',
     261        required = True,
     262        default = None,
     263        source = FutureYearsSource(),
     264        readonly = False,
     265        )               
     266
     267    provider = schema.Choice(
     268        title = u'Applicants container type',
     269        required = True,
     270        default = None,
     271        source = ApplicantContainerProviderSource(),
     272        readonly = False,
     273        )
     274
     275IApplicantsContainerAdd['prefix'].order =  IApplicantsContainer['prefix'].order
     276IApplicantsContainerAdd['year'].order =  IApplicantsContainer['year'].order
     277IApplicantsContainerAdd['provider'].order =  IApplicantsContainer['provider'].order
    239278
    240279class IApplicantBaseData(IWAeUPObject):
Note: See TracChangeset for help on using the changeset viewer.