source: main/waeup.sirp/trunk/src/waeup/sirp/university/course.py @ 5952

Last change on this file since 5952 was 5944, checked in by Henrik Bettermann, 14 years ago

Remove level attribute from course class.

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1"""Courses.
2"""
3import grok
4from zope.interface import implementedBy
5from zope.component.interfaces import IFactory
6from waeup.sirp.university.interfaces import ICourse
7
8class Course(grok.Model):
9    """A university course.
10    """
11    grok.implements(ICourse)
12
13    def __init__(self,
14                 title=u'Unnamed Course',
15                 code=u'NA',
16                 credits=0,
17                 passmark=40,
18                 semester=1, **kw):
19        super(Course, self).__init__(**kw)
20        self.title = title
21        self.code = code
22        self.credits = credits
23        self.passmark = passmark
24        self.semester = semester
25       
26class CourseFactory(grok.GlobalUtility):
27    """A factory for courses.
28    """
29    grok.implements(IFactory)
30    grok.name(u'waeup.Course')
31    title = u"Create a new course.",
32    description = u"This factory instantiates new course instances."
33
34    def __call__(self, *args, **kw):
35        return Course(*args, **kw)
36
37    def getInterfaces(self):
38        return implementedBy(Course)
Note: See TracBrowser for help on using the repository browser.