source: main/waeup.custom/trunk/src/waeup/custom/students/interfaces.py @ 7894

Last change on this file since 7894 was 7822, checked in by Henrik Bettermann, 13 years ago

Rename sirp to kofa.

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1## $Id: interfaces.py 7822 2012-03-09 07:26:31Z henrik $
2##
3## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18from zope import schema
19from waeup.kofa.schema import TextLineChoice
20from waeup.kofa.interfaces import SimpleKofaVocabulary
21from waeup.kofa.students.interfaces import (
22    IStudentBase,IStudentClearance,IStudentPersonal,IStudentNavigation,
23    )
24from waeup.kofa.students.vocabularies import (
25    lgas_vocab, nats_vocab, contextual_reg_num_source)
26
27class IStudentBase(IStudentBase):
28    """Representation of student base data.
29
30    """
31
32    reg_number = TextLineChoice(
33        title = u'Registration Number',
34        required = False,
35        readonly = False,
36        source = contextual_reg_num_source,
37        )
38
39class IStudentPersonal(IStudentPersonal):
40    """Student personal data.
41
42    """
43
44    marit_stat = schema.Choice(
45        title = u'Maritual Status',
46        default = 'unmarried',
47        required = False,
48        vocabulary = SimpleKofaVocabulary(
49            ('Unmarried', 'unmarried'),
50            ('Married', 'married'),)
51        )
52
53class IStudentClearance(IStudentClearance):
54    """Representation of student clearance data.
55
56    """
57    date_of_birth = schema.Date(
58        title = u'Date of Birth',
59        required = False,
60        )
61
62    nationality = schema.Choice(
63        source = nats_vocab,
64        title = u'Nationality',
65        default = 'nigeria',
66        required = False,
67        )
68
69    lga = schema.Choice(
70        source = lgas_vocab,
71        title = u'State/LGA',
72        required = False,
73        )
74
75class IStudent(IStudentBase,IStudentClearance,IStudentPersonal):
76    """Representation of a student.
77
78    """
79
80# Interfaces for students only
81
82class IStudentClearanceEdit(IStudentClearance):
83    """Interface needed for restricted editing of student clearance data.
84
85    """
86
87class IStudentPersonalEdit(IStudentPersonal):
88    """Interface needed for restricted editing of student personal data.
89
90    """
Note: See TracBrowser for help on using the repository browser.