Ignore:
Timestamp:
20 Jun 2015, 07:55:18 (9 years ago)
Author:
Henrik Bettermann
Message:

Improve interfaces for documentation.

File:
1 edited

Legend:

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

    r13077 r13080  
    327327    state, depending on use-case.
    328328    """
     329    state = Attribute('Application state of an applicant')
     330    history = Attribute('Object history, a list of messages')
     331    display_fullname = Attribute('The fullname of an applicant')
     332    application_number = Attribute('The key under which the record is stored')
     333    container_code = Attribute('Code of the parent container')
     334    translated_state = Attribute('Real name of the application state')
     335    special = Attribute('True if special application')
     336    application_number = Attribute('The key under which the record is stored')
     337
     338    application_date = Attribute('UTC datetime of submission, used for export only')
     339    password = Attribute('Encrypted password of a applicant')
     340
     341
     342    suspended = schema.Bool(
     343        title = _(u'Account suspended'),
     344        default = False,
     345        required = False,
     346        )
     347
     348    applicant_id = schema.TextLine(
     349        title = _(u'Applicant Id'),
     350        required = False,
     351        readonly = False,
     352        )
     353
     354    reg_number = TextLineChoice(
     355        title = _(u'Registration Number'),
     356        readonly = False,
     357        required = True,
     358        source = contextual_reg_num_source,
     359        )
     360
     361    firstname = schema.TextLine(
     362        title = _(u'First Name'),
     363        required = True,
     364        )
     365
     366    middlename = schema.TextLine(
     367        title = _(u'Middle Name'),
     368        required = False,
     369        )
     370
     371    lastname = schema.TextLine(
     372        title = _(u'Last Name (Surname)'),
     373        required = True,
     374        )
     375
     376    date_of_birth = FormattedDate(
     377        title = _(u'Date of Birth'),
     378        required = False,
     379        show_year = True,
     380        )
     381
     382    sex = schema.Choice(
     383        title = _(u'Sex'),
     384        source = GenderSource(),
     385        required = True,
     386        )
     387
     388    email = schema.ASCIILine(
     389        title = _(u'Email Address'),
     390        required = False,
     391        constraint=validate_email,
     392        )
     393
     394    phone = PhoneNumber(
     395        title = _(u'Phone'),
     396        description = u'',
     397        required = False,
     398        )
     399
     400    course1 = schema.Choice(
     401        title = _(u'1st Choice Course of Study'),
     402        source = AppCatCertificateSource(),
     403        required = True,
     404        )
     405
     406    course2 = schema.Choice(
     407        title = _(u'2nd Choice Course of Study'),
     408        source = AppCatCertificateSource(),
     409        required = False,
     410        )
     411
     412    #school_grades = schema.List(
     413    #    title = _(u'School Grades'),
     414    #    value_type = ResultEntryField(),
     415    #    required = False,
     416    #    default = [],
     417    #    )
     418
     419    notice = schema.Text(
     420        title = _(u'Notice'),
     421        required = False,
     422        )
     423    student_id = schema.TextLine(
     424        title = _(u'Student Id'),
     425        required = False,
     426        readonly = False,
     427        )
     428    course_admitted = schema.Choice(
     429        title = _(u'Admitted Course of Study'),
     430        source = CertificateSource(),
     431        required = False,
     432        )
     433    locked = schema.Bool(
     434        title = _(u'Form locked'),
     435        default = False,
     436        required = False,
     437        )
     438
     439    special_application = schema.Choice(
     440        title = _(u'Special Application'),
     441        source = SpecialApplicationSource(),
     442        required = False,
     443        )
     444
     445class IApplicant(IApplicantBaseData):
     446    """This is basically the applicant base data. Here we repeat the
     447    fields from base data if we have to set the `required` attribute
     448    to True (which is the default).
     449    """
     450
     451    def writeLogMessage(view, comment):
     452        """Adds an INFO message to the log file
     453        """
     454
     455    def createStudent():
     456        """Create a student object from applicatnt data
     457        and copy applicant object.
     458        """
     459
     460class ISpecialApplicant(IApplicantBase):
     461    """This reduced interface is for former students or students who are not
     462    student users of the portal but have to pay supplementary fees.
     463
     464    This interface is used in browser components only. Thus we can't add
     465    fields here to the regular IApplicant interface here. We can
     466    only 'customize' fields.
     467    """
    329468    history = Attribute('Object history, a list of messages')
    330469    state = Attribute('The application state of an applicant')
     
    340479        )
    341480
    342     applicant_id = schema.TextLine(
    343         title = _(u'Applicant Id'),
    344         required = False,
    345         readonly = False,
    346         )
    347 
    348     reg_number = TextLineChoice(
    349         title = _(u'Registration Number'),
    350         readonly = False,
    351         required = True,
    352         source = contextual_reg_num_source,
    353         )
    354 
    355     firstname = schema.TextLine(
    356         title = _(u'First Name'),
    357         required = True,
    358         )
    359 
    360     middlename = schema.TextLine(
    361         title = _(u'Middle Name'),
    362         required = False,
    363         )
    364 
    365     lastname = schema.TextLine(
    366         title = _(u'Last Name (Surname)'),
    367         required = True,
    368         )
    369 
    370     date_of_birth = FormattedDate(
    371         title = _(u'Date of Birth'),
    372         required = False,
    373         show_year = True,
    374         )
    375 
    376     sex = schema.Choice(
    377         title = _(u'Sex'),
    378         source = GenderSource(),
    379         required = True,
    380         )
    381 
    382     email = schema.ASCIILine(
    383         title = _(u'Email Address'),
    384         required = False,
    385         constraint=validate_email,
    386         )
    387 
    388     phone = PhoneNumber(
    389         title = _(u'Phone'),
    390         description = u'',
    391         required = False,
    392         )
    393 
    394     course1 = schema.Choice(
    395         title = _(u'1st Choice Course of Study'),
    396         source = AppCatCertificateSource(),
    397         required = True,
    398         )
    399 
    400     course2 = schema.Choice(
    401         title = _(u'2nd Choice Course of Study'),
    402         source = AppCatCertificateSource(),
    403         required = False,
    404         )
    405 
    406     #school_grades = schema.List(
    407     #    title = _(u'School Grades'),
    408     #    value_type = ResultEntryField(),
    409     #    required = False,
    410     #    default = [],
    411     #    )
    412 
    413     notice = schema.Text(
    414         title = _(u'Notice'),
    415         required = False,
    416         )
    417     student_id = schema.TextLine(
    418         title = _(u'Student Id'),
    419         required = False,
    420         readonly = False,
    421         )
    422     course_admitted = schema.Choice(
    423         title = _(u'Admitted Course of Study'),
    424         source = CertificateSource(),
    425         required = False,
    426         )
    427     locked = schema.Bool(
    428         title = _(u'Form locked'),
    429         default = False,
    430         required = False,
    431         )
    432 
    433     special_application = schema.Choice(
    434         title = _(u'Special Application'),
    435         source = SpecialApplicationSource(),
    436         required = False,
    437         )
    438 
    439 class IApplicant(IApplicantBaseData):
    440     """This is basically the applicant base data. Here we repeat the
    441     fields from base data if we have to set the `required` attribute
    442     to True (which is the default).
    443     """
    444 
    445     def writeLogMessage(view, comment):
    446         """Adds an INFO message to the log file
    447         """
    448 
    449     def createStudent():
    450         """Create a student object from applicatnt data
    451         and copy applicant object.
    452         """
    453 
    454 class ISpecialApplicant(IApplicantBase):
    455     """This reduced interface is for former students or students who are not
    456     student users of the portal but have to pay supplementary fees.
    457 
    458     This interface is used in browser components only. Thus we can't add
    459     fields here to the regular IApplicant interface here. We can
    460     only 'customize' fields.
    461     """
    462     history = Attribute('Object history, a list of messages')
    463     state = Attribute('The application state of an applicant')
    464     display_fullname = Attribute('The fullname of an applicant')
    465     application_date = Attribute('UTC datetime of submission, used for export only')
    466     password = Attribute('Encrypted password of a applicant')
    467     application_number = Attribute('The key under which the record is stored')
    468 
    469     suspended = schema.Bool(
    470         title = _(u'Account suspended'),
    471         default = False,
    472         required = False,
    473         )
    474 
    475481    locked = schema.Bool(
    476482        title = _(u'Form locked'),
Note: See TracChangeset for help on using the changeset viewer.