Changeset 454 for WAeUP_SRP/trunk/Academics.py
- Timestamp:
- 31 Aug 2006, 10:37:54 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Academics.py
r440 r454 456 456 ###) 457 457 458 class StudyLevel(CPSDocument): ###( 459 """ 460 WAeUP StudyLevel containing the courses and students 461 """ 462 meta_type = 'StudyLevel' 463 portal_type = meta_type 464 security = ClassSecurityInfo() 465 466 security.declareProtected(View,"Title") 467 def Title(self): 468 """compose title""" 469 return "Level %s" % self.aq_parent.getId() 470 471 472 InitializeClass(StudyLevel) 473 474 def addStudyLevel(container, id, REQUEST=None, **kw): 475 """Add a StudyLevel.""" 476 ob = StudyLevel(id, **kw) 477 return CPSBase_adder(container, ob, REQUEST=REQUEST) 478 479 ###) 480 458 481 class CertificateCourse(CPSDocument): ###( 459 482 """ … … 476 499 """compose title""" 477 500 ce = self.getCourseEntry(self.id.upper()) 501 #print self.id, self.aq_parent.id 478 502 if ce: 479 503 return "%s" % ce.Title … … 610 634 ###) 611 635 612 class CourseTicket(CPSDocument): ###( 613 """ 614 WAeUP CourseTicket 615 """ 616 meta_type = 'CourseTicket' 617 portal_type = meta_type 618 security = ClassSecurityInfo() 619 def getCourseEntry(self,cid): 620 res = self.portal_catalog({'meta_type': "Course", 621 'id': cid}) 622 if res: 623 return res[-1] 624 else: 625 return None 626 627 security.declareProtected(View,"Title") 628 def Title(self): 629 """compose title""" 630 ce = self.getCourseEntry(self.id.upper()) 631 if ce: 632 return "%s" % ce.Title 633 return "No such course" 634 635 InitializeClass(CourseTicket) 636 637 def addCourseTicket(container, id, REQUEST=None, **kw): 638 """Add a CourseTicket.""" 639 ob = CourseTicket(id, **kw) 640 return CPSBase_adder(container, ob, REQUEST=REQUEST) 641 ###) 642 636
Note: See TracChangeset for help on using the changeset viewer.