students.vocabularies - Student Vocabularies

Vocabularies and sources for the students section.

waeup.kofa.students.vocabularies.COUNTRIES = ((u'Nigeria', u'NG'), (u'Afghanistan', u'AF'), (u'\xc5land Islands', u'AX'), (u'Albania', u'AL'), (u'Algeria', u'DZ'), (u'American Samoa', u'AS'), (u'Andorra', u'AD'), (u'Angola', u'AO'), (u'Anguilla', u'AI'), (u'Antarctica', u'AQ'), (u'Antigua and Barbuda', u'AG'), (u'Argentina', u'AR'), (u'Armenia', u'AM'), (u'Aruba', u'AW'), (u'Australia', u'AU'), (u'Austria', u'AT'), (u'Azerbaijan', u'AZ'), (u'Bahamas', u'BS'), (u'Bahrain', u'BH'), (u'Bangladesh', u'BD'), (u'Barbados', u'BB'), (u'Belarus', u'BY'), (u'Belgium', u'BE'), (u'Belize', u'BZ'), (u'Benin', u'BJ'), (u'Bermuda', u'BM'), (u'Bhutan', u'BT'), (u'Bolivia, Plurinational State of', u'BO'), (u'Bonaire, Sint Eustatius and Saba', u'BQ'), (u'Bosnia and Herzegovina', u'BA'), (u'Botswana', u'BW'), (u'Bouvet Island', u'BV'), (u'Brazil', u'BR'), (u'British Indian Ocean Territory', u'IO'), (u'Brunei Darussalam', u'BN'), (u'Bulgaria', u'BG'), (u'Burkina Faso', u'BF'), (u'Burundi', u'BI'), (u'Cambodia', u'KH'), (u'Cameroon', u'CM'), (u'Canada', u'CA'), (u'Cape Verde', u'CV'), (u'Cayman Islands', u'KY'), (u'Central African Republic', u'CF'), (u'Chad', u'TD'), (u'Chile', u'CL'), (u'China', u'CN'), (u'Christmas Island', u'CX'), (u'Cocos (Keeling) Islands', u'CC'), (u'Colombia', u'CO'), (u'Comoros', u'KM'), (u'Congo', u'CG'), (u'Congo, the Democratic Republic of the', u'CD'), (u'Cook Islands', u'CK'), (u'Costa Rica', u'CR'), (u"C\xf4te d'Ivoire", u'CI'), (u'Croatia', u'HR'), (u'Cuba', u'CU'), (u'Cura\xe7ao', u'CW'), (u'Cyprus', u'CY'), (u'Czech Republic', u'CZ'), (u'Denmark', u'DK'), (u'Djibouti', u'DJ'), (u'Dominica', u'DM'), (u'Dominican Republic', u'DO'), (u'Ecuador', u'EC'), (u'Egypt', u'EG'), (u'El Salvador', u'SV'), (u'Equatorial Guinea', u'GQ'), (u'Eritrea', u'ER'), (u'Estonia', u'EE'), (u'Ethiopia', u'ET'), (u'Falkland Islands (Malvinas)', u'FK'), (u'Faroe Islands', u'FO'), (u'Fiji', u'FJ'), (u'Finland', u'FI'), (u'France', u'FR'), (u'French Guiana', u'GF'), (u'French Polynesia', u'PF'), (u'French Southern Territories', u'TF'), (u'Gabon', u'GA'), (u'Gambia', u'GM'), (u'Georgia', u'GE'), (u'Germany', u'DE'), (u'Ghana', u'GH'), (u'Gibraltar', u'GI'), (u'Greece', u'GR'), (u'Greenland', u'GL'), (u'Grenada', u'GD'), (u'Guadeloupe', u'GP'), (u'Guam', u'GU'), (u'Guatemala', u'GT'), (u'Guernsey', u'GG'), (u'Guinea', u'GN'), (u'Guinea-bissau', u'GW'), (u'Guyana', u'GY'), (u'Haiti', u'HT'), (u'Heard Island and Mcdonald Islands', u'HM'), (u'Holy See (Vatican City State)', u'VA'), (u'Honduras', u'HN'), (u'Hong Kong', u'HK'), (u'Hungary', u'HU'), (u'Iceland', u'IS'), (u'India', u'IN'), (u'Indonesia', u'ID'), (u'Iran, Islamic Republic of', u'IR'), (u'Iraq', u'IQ'), (u'Ireland', u'IE'), (u'Isle of Man', u'IM'), (u'Israel', u'IL'), (u'Italy', u'IT'), (u'Jamaica', u'JM'), (u'Japan', u'JP'), (u'Jersey', u'JE'), (u'Jordan', u'JO'), (u'Kazakhstan', u'KZ'), (u'Kenya', u'KE'), (u'Kiribati', u'KI'), (u"Korea, Democratic People's Republic of", u'KP'), (u'Korea, Republic of', u'KR'), (u'Kuwait', u'KW'), (u'Kyrgyzstan', u'KG'), (u"Lao People's Democratic Republic", u'LA'), (u'Latvia', u'LV'), (u'Lebanon', u'LB'), (u'Lesotho', u'LS'), (u'Liberia', u'LR'), (u'Libya', u'LY'), (u'Liechtenstein', u'LI'), (u'Lithuania', u'LT'), (u'Luxembourg', u'LU'), (u'Macao', u'MO'), (u'Macedonia, the Former Yugoslav Republic of', u'MK'), (u'Madagascar', u'MG'), (u'Malawi', u'MW'), (u'Malaysia', u'MY'), (u'Maldives', u'MV'), (u'Mali', u'ML'), (u'Malta', u'MT'), (u'Marshall Islands', u'MH'), (u'Martinique', u'MQ'), (u'Mauritania', u'MR'), (u'Mauritius', u'MU'), (u'Mayotte', u'YT'), (u'Mexico', u'MX'), (u'Micronesia, Federated States of', u'FM'), (u'Moldova, Republic of', u'MD'), (u'Monaco', u'MC'), (u'Mongolia', u'MN'), (u'Montenegro', u'ME'), (u'Montserrat', u'MS'), (u'Morocco', u'MA'), (u'Mozambique', u'MZ'), (u'Myanmar', u'MM'), (u'Namibia', u'NA'), (u'Nauru', u'NR'), (u'Nepal', u'NP'), (u'Netherlands', u'NL'), (u'New Caledonia', u'NC'), (u'New Zealand', u'NZ'), (u'Nicaragua', u'NI'), (u'Niger', u'NE'), (u'Niue', u'NU'), (u'Norfolk Island', u'NF'), (u'Northern Mariana Islands', u'MP'), (u'Norway', u'NO'), (u'Oman', u'OM'), (u'Pakistan', u'PK'), (u'Palau', u'PW'), (u'Palestinian Territory, Occupied', u'PS'), (u'Panama', u'PA'), (u'Papua New Guinea', u'PG'), (u'Paraguay', u'PY'), (u'Peru', u'PE'), (u'Philippines', u'PH'), (u'Pitcairn', u'PN'), (u'Poland', u'PL'), (u'Portugal', u'PT'), (u'Puerto Rico', u'PR'), (u'Qatar', u'QA'), (u'R\xe9union', u'RE'), (u'Romania', u'RO'), (u'Russian Federation', u'RU'), (u'Rwanda', u'RW'), (u'Saint Barth\xe9lemy', u'BL'), (u'Saint Helena, Ascension and Tristan Da Cunha', u'SH'), (u'Saint Kitts and Nevis', u'KN'), (u'Saint Lucia', u'LC'), (u'Saint Martin (French Part)', u'MF'), (u'Saint Pierre and Miquelon', u'PM'), (u'Saint Vincent and the Grenadines', u'VC'), (u'Samoa', u'WS'), (u'San Marino', u'SM'), (u'Sao Tome and Principe', u'ST'), (u'Saudi Arabia', u'SA'), (u'Senegal', u'SN'), (u'Serbia', u'RS'), (u'Seychelles', u'SC'), (u'Sierra Leone', u'SL'), (u'Singapore', u'SG'), (u'Sint Maarten (Dutch Part)', u'SX'), (u'Slovakia', u'SK'), (u'Slovenia', u'SI'), (u'Solomon Islands', u'SB'), (u'Somalia', u'SO'), (u'South Africa', u'ZA'), (u'South Georgia and the South Sandwich Islands', u'GS'), (u'South Sudan', u'SS'), (u'Spain', u'ES'), (u'Sri Lanka', u'LK'), (u'Sudan', u'SD'), (u'Suriname', u'SR'), (u'Svalbard and Jan Mayen', u'SJ'), (u'Swaziland', u'SZ'), (u'Sweden', u'SE'), (u'Switzerland', u'CH'), (u'Syrian Arab Republic', u'SY'), (u'Taiwan, Province of China', u'TW'), (u'Tajikistan', u'TJ'), (u'Tanzania, United Republic of', u'TZ'), (u'Thailand', u'TH'), (u'Timor-leste', u'TL'), (u'Togo', u'TG'), (u'Tokelau', u'TK'), (u'Tonga', u'TO'), (u'Trinidad and Tobago', u'TT'), (u'Tunisia', u'TN'), (u'Turkey', u'TR'), (u'Turkmenistan', u'TM'), (u'Turks and Caicos Islands', u'TC'), (u'Tuvalu', u'TV'), (u'Uganda', u'UG'), (u'Ukraine', u'UA'), (u'United Arab Emirates', u'AE'), (u'United Kingdom', u'GB'), (u'United States', u'US'), (u'United States Minor Outlying Islands', u'UM'), (u'Uruguay', u'UY'), (u'Uzbekistan', u'UZ'), (u'Vanuatu', u'VU'), (u'Venezuela, Bolivarian Republic of', u'VE'), (u'Viet Nam', u'VN'), (u'Virgin Islands, British', u'VG'), (u'Virgin Islands, U.S.', u'VI'), (u'Wallis and Futuna', u'WF'), (u'Western Sahara', u'EH'), (u'Yemen', u'YE'), (u'Zambia', u'ZM'), (u'Zimbabwe', u'ZW'))

a tuple of tuples (<COUNTRY-NAME>, <ISO-CODE>) with Nigeria first.

class waeup.kofa.students.vocabularies.GenderSource[source]

Bases: zc.sourcefactory.basic.BasicSourceFactory

A gender source delivers basically a mapping {'m': 'Male', 'f': 'Female'}

Using a source, we make sure that the tokens (which are stored/expected for instance from CSV files) are something one can expect and not cryptic IntIDs.

__doc__ = "A gender source delivers basically a mapping\n ``{'m': 'Male', 'f': 'Female'}``\n\n Using a source, we make sure that the tokens (which are\n stored/expected for instance from CSV files) are something one\n can expect and not cryptic IntIDs.\n "
__module__ = 'waeup.kofa.students.vocabularies'
getTitle(value)[source]
getToken(value)[source]
getValues()[source]
exception waeup.kofa.students.vocabularies.MatNumNotInSource[source]

Bases: zope.schema._bootstrapinterfaces.ValidationError

Matriculation number exists already

__doc__ = 'Matriculation number exists already\n '
__module__ = 'waeup.kofa.students.vocabularies'
class waeup.kofa.students.vocabularies.MatNumberSource(context)[source]

Bases: waeup.kofa.students.vocabularies.RegNumberSource

__doc__ = None
__module__ = 'waeup.kofa.students.vocabularies'
field_name = 'matric_number'
validation_error

alias of MatNumNotInSource

exception waeup.kofa.students.vocabularies.RegNumNotInSource[source]

Bases: zope.schema._bootstrapinterfaces.ValidationError

Registration number exists already

__doc__ = 'Registration number exists already\n '
__module__ = 'waeup.kofa.students.vocabularies'
class waeup.kofa.students.vocabularies.RegNumberSource(context)[source]

Bases: object

A source that accepts any entry for a certain field if not used already.

Using this kind of source means a way of setting an invariant.

We accept a value iff: - the value cannot be found in catalog or - the value can be found as part of some item but the bound item is the context object itself.

__contains__(value)[source]

We accept all values not already given to other students.

__dict__ = dict_proxy({'__providedBy__': <_interface_coptimizations.ObjectSpecificationDescriptor object at 0x2ba7d007e2b0>, '__module__': 'waeup.kofa.students.vocabularies', 'cat_name': 'students_catalog', 'validation_error': <class 'waeup.kofa.students.vocabularies.RegNumNotInSource'>, '__contains__': <function __contains__ at 0x2ba7d5b99938>, '__weakref__': <attribute '__weakref__' of 'RegNumberSource' objects>, '__provides__': <zope.interface.declarations.ClassProvides object at 0x2ba7d63d5b50>, 'comp_field': 'student_id', '__dict__': <attribute '__dict__' of 'RegNumberSource' objects>, '__implemented__': <implementedBy waeup.kofa.students.vocabularies.RegNumberSource>, 'field_name': 'reg_number', '__doc__': 'A source that accepts any entry for a certain field if not used\n already.\n\n Using this kind of source means a way of setting an invariant.\n\n We accept a value iff:\n - the value cannot be found in catalog or\n - the value can be found as part of some item but the bound item\n is the context object itself.\n ', '__init__': <function __init__ at 0x2ba7d5b998c0>})
__doc__ = 'A source that accepts any entry for a certain field if not used\n already.\n\n Using this kind of source means a way of setting an invariant.\n\n We accept a value iff:\n - the value cannot be found in catalog or\n - the value can be found as part of some item but the bound item\n is the context object itself.\n '
__implemented__ = <implementedBy waeup.kofa.students.vocabularies.RegNumberSource>
__init__(context)[source]
__module__ = 'waeup.kofa.students.vocabularies'
__providedBy__

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']
__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']
__weakref__

list of weak references to the object (if defined)

cat_name = 'students_catalog'
comp_field = 'student_id'
field_name = 'reg_number'
validation_error

alias of RegNumNotInSource

class waeup.kofa.students.vocabularies.StudyLevelSource[source]

Bases: zc.sourcefactory.contextual.BasicContextualSourceFactory

The StudyLevelSource is based on and extends the course_levels vocabulary defined in the university package. Repeating study levels are denoted by increments of 10, the first spillover level by the certificate’s end level plus 100 and the second spillover level by the end level plus 110.

__doc__ = "The StudyLevelSource is based on and extends the\n course_levels vocabulary defined in the university package.\n Repeating study levels are denoted by increments of 10, the\n first spillover level by the certificate's end level plus 100\n and the second spillover level by the end level plus 110.\n "
__module__ = 'waeup.kofa.students.vocabularies'
getTitle(context, value)[source]
getToken(context, value)[source]
getValues(context)[source]
waeup.kofa.students.vocabularies.contextual_mat_num_source(context)[source]
waeup.kofa.students.vocabularies.contextual_reg_num_source(context)[source]
waeup.kofa.students.vocabularies.levels_from_range(start_level=None, end_level=None)[source]

Get a list of valid levels for given start/end level.

Start and end level must be numbers (or None).

If no start/end level is given, return the default list of levels.

If only one of start_level or end_level is given, the result is undefined.

waeup.kofa.students.vocabularies.study_levels(context)[source]