source: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/studylevel.py @ 9554

Last change on this file since 9554 was 8863, checked in by Henrik Bettermann, 12 years ago

Rename all classes from CustomXYZ to NigeriaXYZ.

Customize PhoneWidget? for Nigeria here.

  • Property svn:keywords set to Id
File size: 2.7 KB
RevLine 
[8862]1## $Id: studylevel.py 8863 2012-07-01 12:31:04Z 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##
18"""
19Container which holds the data of a student study level
20and contains the course tickets.
21"""
22import grok
23from zope.component.interfaces import IFactory
24from zope.interface import implementedBy
25from waeup.kofa.utils.helpers import attrs_to_fields
26from waeup.kofa.students.studylevel import (
27    StudentStudyLevel, CourseTicket,
28    CourseTicketFactory, StudentStudyLevelFactory)
29from kofacustom.nigeria.students.interfaces import (
[8863]30    INigeriaStudentStudyLevel, IStudentNavigation, INigeriaCourseTicket)
[8862]31
32
[8863]33class NigeriaStudentStudyLevel(StudentStudyLevel):
[8862]34    """This is a container for course tickets.
35    """
[8863]36    grok.implements(INigeriaStudentStudyLevel, IStudentNavigation)
37    grok.provides(INigeriaStudentStudyLevel)
[8862]38
[8863]39NigeriaStudentStudyLevel = attrs_to_fields(NigeriaStudentStudyLevel)
[8862]40
[8863]41class NigeriaStudentStudyLevelFactory(StudentStudyLevelFactory):
[8862]42    """A factory for student study levels.
43    """
44
45    def __call__(self, *args, **kw):
[8863]46        return NigeriaStudentStudyLevel()
[8862]47
48    def getInterfaces(self):
[8863]49        return implementedBy(NigeriaStudentStudyLevel)
[8862]50
[8863]51class NigeriaCourseTicket(CourseTicket):
[8862]52    """This is a course ticket which allows the
53    student to attend the course. Lecturers will enter scores and more at
54    the end of the term.
55
56    A course ticket contains a copy of the original course and
57    course referrer data. If the courses and/or their referrers are removed, the
58    corresponding tickets remain unchanged. So we do not need any event
59    triggered actions on course tickets.
60    """
[8863]61    grok.implements(INigeriaCourseTicket, IStudentNavigation)
62    grok.provides(INigeriaCourseTicket)
[8862]63
[8863]64NigeriaCourseTicket = attrs_to_fields(NigeriaCourseTicket)
[8862]65
[8863]66class NigeriaCourseTicketFactory(CourseTicketFactory):
[8862]67    """A factory for student study levels.
68    """
69
70    def __call__(self, *args, **kw):
[8863]71        return NigeriaCourseTicket()
[8862]72
73    def getInterfaces(self):
[8863]74        return implementedBy(NigeriaCourseTicket)
Note: See TracBrowser for help on using the repository browser.