applicants - Application Components Package

(see also: Submodules)

This package contains everything regarding university applicants.

class waeup.kofa.applicants.Applicant[source]
__doc__ = None
__implemented__ = <implementedBy waeup.kofa.applicants.applicant.Applicant>
__init__()[source]
__module__ = 'waeup.kofa.applicants.applicant'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
_copyPassportImage(student)[source]

Copy any passport image over to student location.

_saveApplicationPDF(student, applicant_slip, view=None)[source]

Create an application slip as PDF and store it in student folder.

_setStudyCourseAttributes(studycourse)[source]
applicant_id

Applicant Id (computed attribute)

applicant_student_mapping = [('firstname', 'firstname'), ('middlename', 'middlename'), ('lastname', 'lastname'), ('sex', 'sex'), ('date_of_birth', 'date_of_birth'), ('email', 'email'), ('phone', 'phone')]
application_number
container_code
course1

1st Choice Course of Study (computed attribute)

course2

2nd Choice Course of Study (computed attribute)

course_admitted

Admitted Course of Study (computed attribute)

createStudent(view=None)[source]

Create a student, fill with base data, create an application slip and copy applicant data.

date_of_birth

Date of Birth (computed attribute)

display_fullname
email

Email Address (computed attribute)

firstname

First Name (computed attribute)

history
lastname

Last Name (Surname) (computed attribute)

locked

Form locked (computed attribute)

middlename

Middle Name (computed attribute)

notice

Notice (computed attribute)

payments
phone

Phone (computed attribute)

refereereports
referees

Referees (computed attribute)

reg_number

Registration Number (computed attribute)

school_grades

School Grades (computed attribute)

sex

Sex (computed attribute)

special
special_application

Special Application (computed attribute)

state
student_id

Student Id (computed attribute)

suspended

Account suspended (computed attribute)

translated_state
writeLogMessage(view, message)[source]
class waeup.kofa.applicants.ApplicantFactory[source]

A factory for applicants.

__call__(*args, **kw)[source]
__doc__ = 'A factory for applicants.\n '
__implemented__ = <implementedBy waeup.kofa.applicants.applicant.ApplicantFactory>
__module__ = 'waeup.kofa.applicants.applicant'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
description = u'This factory instantiates new applicant instances.'
getInterfaces()[source]
title = (u'Create a new applicant.',)
class waeup.kofa.applicants.ApplicantImageNameChooser(context)[source]

A file id chooser for Applicant objects.

context is an Applicant instance.

The ApplicantImageNameChooser can build/check file ids for Applicant objects suitable for use with ExtFileStore instances. The delivered file_id contains the file id marker for Applicant object and the registration number or access code of the context applicant. Also the name of the connected applicant container will be part of the generated file id.

This chooser is registered as an adapter providing waeup.kofa.interfaces.IFileStoreNameChooser.

File store name choosers like this one are only convenience components to ease the task of creating file ids for applicant objects. You are nevertheless encouraged to use them instead of manually setting up filenames for applicants.

__doc__ = 'A file id chooser for :class:`Applicant` objects.\n\n `context` is an :class:`Applicant` instance.\n\n The :class:`ApplicantImageNameChooser` can build/check file ids\n for :class:`Applicant` objects suitable for use with\n :class:`ExtFileStore` instances. The delivered file_id contains\n the file id marker for :class:`Applicant` object and the\n registration number or access code of the context applicant. Also\n the name of the connected applicant container will be part of the\n generated file id.\n\n This chooser is registered as an adapter providing\n :class:`waeup.kofa.interfaces.IFileStoreNameChooser`.\n\n File store name choosers like this one are only convenience\n components to ease the task of creating file ids for applicant\n objects. You are nevertheless encouraged to use them instead of\n manually setting up filenames for applicants.\n\n .. seealso:: :mod:`waeup.kofa.imagestorage`\n\n '
__implemented__ = <implementedBy waeup.kofa.applicants.applicant.ApplicantImageNameChooser>
__module__ = 'waeup.kofa.applicants.applicant'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
checkName(name=None, attr=None)[source]

Check whether the given name is a valid file id for the context.

Returns True only if name equals the result of chooseName().

The attr parameter is not taken into account for Applicant context as the single passport image is the only file we store for applicants.

chooseName(name=None, attr=None)[source]

Get a valid file id for applicant context.

Example:

For an applicant with applicant_id. 'app2001_1234' and stored in an applicants container called 'mycontainer', this chooser would create:

'__img-applicant__mycontainer/app2001_1234.jpg'

meaning that the passport image of this applicant would be stored in the site-wide file storage in path:

mycontainer/app2001_1234.jpg

If the context applicant has no parent, '_default' is used as parent name.

In the beginning the attr parameter was not taken into account for Applicant context as the single passport image was the only file we store for applicants. Meanwhile FUTMinna requires uploads of other documents too. Now we store passport image files without attribute but all other documents with.

class waeup.kofa.applicants.ApplicantImageStoreHandler[source]

Applicant specific image handling.

This handler knows in which path in a filestore to store applicant images and how to turn this kind of data into some (browsable) file object.

It is called from the global file storage, when it wants to get/store a file with a file id starting with __img-applicant__ (the marker string for applicant images).

Like each other file store handler it does not handle the files really (this is done by the global file store) but only computes paths and things like this.

__doc__ = 'Applicant specific image handling.\n\n This handler knows in which path in a filestore to store applicant\n images and how to turn this kind of data into some (browsable)\n file object.\n\n It is called from the global file storage, when it wants to\n get/store a file with a file id starting with\n ``__img-applicant__`` (the marker string for applicant images).\n\n Like each other file store handler it does not handle the files\n really (this is done by the global file store) but only computes\n paths and things like this.\n '
__implemented__ = <implementedBy waeup.kofa.applicants.applicant.ApplicantImageStoreHandler>
__module__ = 'waeup.kofa.applicants.applicant'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
createFile(store, root, filename, file_id, file)[source]

Create a browsable file-like object.

pathFromFileID(store, root, file_id)[source]

All applicants images are filed in directory applicants.

class waeup.kofa.applicants.ApplicantPrincipalRoleManager(context)[source]
__doc__ = None
__module__ = 'waeup.kofa.applicants.dynamicroles'
extra_attrib = 'course1'
getRolesForPrincipal(principal_id)[source]

Get roles for principal with id principal_id.

Different to the default implementation, this method also takes into account local roles set on any department connected to the context student.

If the given principal has at least one of the external_rolenames roles granted for the external object, it additionally gets additional_rolename role for the context student.

For the additional roles the extra_attrib and all its parent objects are looked up, because ‘role inheritance’ does not work on that basic level of permission handling.

Some advantages of this approach:

  • we don’t have to store extra local roles for clearance officers in ZODB for each student
  • when local roles on a department change, we don’t have to update thousands of students; the local role is assigned dynamically.

Disadvantage:

  • More expensive role lookups when a clearance officer wants to see an student form.

This implementation is designed to be usable also for other contexts than students. You can inherit from it and set different role names to lookup/set easily via the static class attributes.

rolename_mapping = {'waeup.local.ApplicationsManager': 'waeup.ApplicationsManager'}
class waeup.kofa.applicants.ApplicantsContainer[source]

An applicants container contains university applicants.

__doc__ = 'An applicants container contains university applicants.\n '
__implemented__ = <implementedBy waeup.kofa.applicants.container.ApplicantsContainer>
__module__ = 'waeup.kofa.applicants.container'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
addApplicant(applicant)[source]

Add an applicant.

application_category

Category for the grouping of certificates (computed attribute)

application_fee

Application Fee (computed attribute)

application_slip_notice

Human readable notice on application slip in HTML format (computed attribute)

code

Code (computed attribute)

counts
description

Human readable description in HTML format (computed attribute)

description_dict = {}
enddate

Application Closing Date (computed attribute)

expired
first_unused
hidden

Hide container (computed attribute)

local_roles = ['waeup.local.ApplicationsManager']
mode

Application Mode (computed attribute)

prefix

Application Target (computed attribute)

startdate

Application Start Date (computed attribute)

statistics
strict_deadline

Forbid additions after deadline (enddate) (computed attribute)

title

Title (computed attribute)

traverse(name)[source]

Deliver virtual export container.

writeLogMessage(view, message)[source]
year

Year of Entrance (computed attribute)

class waeup.kofa.applicants.ApplicantsRoot[source]

The root of applicants-related components. It contains only containers for applicants.

__doc__ = 'The root of applicants-related components. It contains only\n containers for applicants.\n '
__implemented__ = <implementedBy waeup.kofa.applicants.root.ApplicantsRoot>
__module__ = 'waeup.kofa.applicants.root'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
description

Human readable description in HTML format (computed attribute)

description_dict = {}
local_roles = []
logger_filename = 'applicants.log'
logger_name = 'waeup.kofa.${sitename}.applicants'