applicants.applicant - Applicant Components

waeup.kofa.applicants.applicant.APPLICANT_IMAGE_STORE_NAME = 'img-applicant'

The file id marker for applicant passport images

class waeup.kofa.applicants.applicant.Applicant[source]

Bases: grokcore.content.components.Container

__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']
_copyFiles(student)[source]

Copy all other files over to student location. Not used in base package but tested with fake file.

_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.

_setGraduatedStudyCourseAttributes(studycourse)[source]
_setStudyCourseAttributes(studycourse)[source]
applicant_graduated_mapping = [('firstname', 'firstname'), ('middlename', 'middlename'), ('lastname', 'lastname'), ('sex', 'sex'), ('date_of_birth', 'date_of_birth'), ('email', 'email'), ('phone', 'phone')]
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, graduated=False, send_email=False)[source]

Create a student, fill with base data, create an application slip, copy applicant data and files, send an email (optional).

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

Gender (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.applicant.ApplicantFactory[source]

Bases: grokcore.component.components.GlobalUtility

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.applicant.ApplicantImageNameChooser(context)[source]

Bases: grokcore.component.components.Adapter

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 many universities require uploads of other documents too. Now we store passport image files without attribute but all other documents with.

class waeup.kofa.applicants.applicant.ApplicantImageStoreHandler[source]

Bases: waeup.kofa.imagestorage.DefaultFileStoreHandler, grokcore.component.components.GlobalUtility

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.

waeup.kofa.applicants.applicant.handle_applicant_added(applicant, event)[source]

If an applicant is added local and site roles are assigned.

waeup.kofa.applicants.applicant.handle_applicant_removed(applicant, event)[source]

If an applicant is removed a message is logged, passport images are deleted and the global role is unset.

waeup.kofa.applicants.applicant.search(query=None, searchtype=None, view=None)[source]