source: main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py @ 9905

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

Remove school fee installment payments and restricted course registration. Seems that all these customizations have been a waste of time.

  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1## $Id: studylevel.py 9905 2013-01-22 08:55:00Z 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.component import createObject
25from zope.interface import implementedBy
26from waeup.kofa.utils.helpers import attrs_to_fields
27from waeup.kofa.students.studylevel import (
28    StudentStudyLevel, CourseTicket,
29    CourseTicketFactory, StudentStudyLevelFactory)
30from waeup.kofa.students.interfaces import IStudentNavigation
31from waeup.aaue.students.interfaces import (
32    ICustomStudentStudyLevel, ICustomCourseTicket)
33
34
35class CustomStudentStudyLevel(StudentStudyLevel):
36    """This is a container for course tickets.
37    """
38    grok.implements(ICustomStudentStudyLevel, IStudentNavigation)
39    grok.provides(ICustomStudentStudyLevel)
40
41CustomStudentStudyLevel = attrs_to_fields(
42    CustomStudentStudyLevel, omit=['total_credits', 'gpa'])
43
44class CustomStudentStudyLevelFactory(StudentStudyLevelFactory):
45    """A factory for student study levels.
46    """
47
48    def __call__(self, *args, **kw):
49        return CustomStudentStudyLevel()
50
51    def getInterfaces(self):
52        return implementedBy(CustomStudentStudyLevel)
53
54class CustomCourseTicket(CourseTicket):
55    """This is a course ticket which allows the
56    student to attend the course. Lecturers will enter scores and more at
57    the end of the term.
58
59    A course ticket contains a copy of the original course and
60    course referrer data. If the courses and/or their referrers are removed, the
61    corresponding tickets remain unchanged. So we do not need any event
62    triggered actions on course tickets.
63    """
64    grok.implements(ICustomCourseTicket, IStudentNavigation)
65    grok.provides(ICustomCourseTicket)
66
67CustomCourseTicket = attrs_to_fields(CustomCourseTicket)
68
69class CustomCourseTicketFactory(CourseTicketFactory):
70    """A factory for student study levels.
71    """
72
73    def __call__(self, *args, **kw):
74        return CustomCourseTicket()
75
76    def getInterfaces(self):
77        return implementedBy(CustomCourseTicket)
Note: See TracBrowser for help on using the repository browser.