Changeset 4321 for waeup/branches/ulif-rewrite
- Timestamp:
- 20 Jun 2009, 19:22:48 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/university/certificate.py
r4318 r4321 4 4 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 5 5 from zope.component.interfaces import IFactory 6 from waeup.interfaces import ICertificate, ICertificateContainer 6 from waeup.interfaces import (ICertificate, ICertificateContainer, 7 ICertificateCourse) 7 8 8 9 class Certificate(grok.Container): … … 28 29 29 30 def check(self): 31 """Set Review State to ``checked``. 32 """ 30 33 self.setReviewState('check') 31 34 … … 36 39 info = IWorkflowInfo(self) 37 40 info.fireTransition(transition_id) 41 return 42 43 def addCourseRef(self, course, level=100, core_or_elective=True): 44 """Add a course reference. 45 """ 46 code = course.code 47 self[code] = CertificateCourse(course, level, core_or_elective) 48 49 def delCourseRef(self, code): 50 """Delete a course denoted by its code. 51 """ 52 if code in self.keys(): 53 del self[code] 54 self._p_changed = True 38 55 return 39 56 … … 54 71 def getInterfaces(self): 55 72 return implementedBy(Certificate) 73 74 class CertificateCourse(grok.Model): 75 grok.implements(ICertificateCourse) 76 77 def __init__(self, course=None, level=100, core_or_elective=True): 78 # XXX Make sure, this reference is deleted, when the course 79 # does not exist anymore (or the referenced course will still 80 # exist here). 81 self.course = course 82 self.level = level 83 self.core_or_elective = core_or_elective
Note: See TracChangeset for help on using the changeset viewer.