Changeset 8920 for main/waeup.kofa/trunk/src/waeup/kofa/university
- Timestamp:
- 5 Jul 2012, 14:48:51 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/university
- Files:
-
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/university/api.txt
r7811 r8920 28 28 :maxdepth: 1 29 29 30 c ourserefs.txt30 certcourses.txt -
main/waeup.kofa/trunk/src/waeup/kofa/university/batching.py
r8302 r8920 317 317 def addEntry(self, obj, row, site): 318 318 parent = self.getParent(row, site) 319 parent.addC ourseRef(row['course'],319 parent.addCertCourse(row['course'], 320 320 row['level'], row['mandatory']) 321 321 return … … 323 323 def delEntry(self, row, site): 324 324 parent = self.getParent(row, site) 325 parent.delC ourseRef(row['course'].code, row['level'])326 return 325 parent.delCertCourse(row['course'].code, row['level']) 326 return -
main/waeup.kofa/trunk/src/waeup/kofa/university/catalog.py
r7811 r8920 159 159 self.title = context.course.title 160 160 self.code = context.getCourseCode 161 self.type = 'C ourse Referrer'161 self.type = 'Certificate Course' 162 162 163 163 def search(query=None, view=None): -
main/waeup.kofa/trunk/src/waeup/kofa/university/certcourses.txt
r8898 r8920 1 C ourse referrers2 **************** 1 Certificate Courses 2 ******************* 3 3 4 4 Courses are referred to by certificate courses. … … 64 64 >>> fac['DEPT'].certificates.addCertificate(cert) 65 65 66 >>> fac['DEPT'].certificates['CERT'].addC ourseRef(66 >>> fac['DEPT'].certificates['CERT'].addCertCourse( 67 67 ... fac['DEPT'].courses['CRS1']) 68 68 69 >>> fac['DEPT'].certificates['CERT'].addC ourseRef(69 >>> fac['DEPT'].certificates['CERT'].addCertCourse( 70 70 ... fac['DEPT2'].courses['CRS2']) 71 71 72 72 We add the latter course again, but this time for the second level: 73 73 74 >>> fac['DEPT'].certificates['CERT'].addC ourseRef(74 >>> fac['DEPT'].certificates['CERT'].addCertCourse( 75 75 ... fac['DEPT2'].courses['CRS2'], level=200) 76 76 -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.py
r8738 r8920 63 63 return "%s (%s)" % (self.title,self.code) 64 64 65 def addC ourseRef(self, course, level=100, mandatory=True):66 """Add a c ourse referrer.65 def addCertCourse(self, course, level=100, mandatory=True): 66 """Add a certificate course. 67 67 """ 68 68 code = "%s_%s" % (course.code, level) … … 72 72 self._p_changed = True 73 73 74 def delC ourseRef(self, code, level=None):75 """Delete a c ourse referrerdenoted by its code.74 def delCertCourse(self, code, level=None): 75 """Delete a certificate course denoted by its code. 76 76 """ 77 77 keys = list(self.keys()) # create list copy -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.txt
r7819 r8920 96 96 .. XXX: This is not a proper description 97 97 98 .. method:: addC ourseRef(course[, level=100,[ mandatory=True]])99 100 Add a referrer of acourse. A course is an object implementing98 .. method:: addCertCourse(course[, level=100,[ mandatory=True]]) 99 100 Add a certificate course. A course is an object implementing 101 101 :class:`waeup.kofa.interfaces.ICourse`. 102 102 103 Please don't be confused by the term ' referrer'. As course objects104 will normaly be stored105 in a department, the c ourse referrer refers to103 Please don't be confused by the term 'certificate course'. 104 As course objects will normaly be stored 105 in a department, the certificate course refers to 106 106 the 'real' course in the department container. 107 107 108 .. method:: delC ourseRef(code)109 110 Remove a c ourse referrerfrom a certificate.111 112 The referrermust be given by its code number.108 .. method:: delCertCourse(code) 109 110 Remove a certificate course from a certificate. 111 112 The certificate course must be given by its code number. 113 113 114 114 :class:`CertificateCourse` … … 117 117 .. class:: CertificateCourse(course[, level=100[, mandatory=True]]) 118 118 119 Create a c ourse referrer.120 121 A certificate course (old term) or course referrerare held in119 Create a certificate course. 120 121 A certificate course are held in 122 122 certificates and refer to an existing :class:`Course` instance held 123 123 elsewhere. 124 124 125 A certificate can require several c ourse referrers and one126 c ourse referrercan be required by several certificates.125 A certificate can require several certificate courses and one 126 certificate course can be required by several certificates. 127 127 128 128 .. attribute:: course … … 225 225 226 226 To accomplish that, the parents of the removed course are looked up 227 for a certifcate container which contains a c ourse referrerthat227 for a certifcate container which contains a certificate course that 228 228 refers to the deleted course. 229 229 … … 341 341 >>> mycert.code = 'MYCERT' 342 342 >>> mydept.certificates.addCertificate(mycert) 343 >>> mycert.addC ourseRef(mycourse)343 >>> mycert.addCertCourse(mycourse) 344 344 345 345 >>> transaction.commit() … … 354 354 ['mydept'] 355 355 356 The c ourse referrerwe stored in the certificate is indeed a356 The certificate course we stored in the certificate is indeed a 357 357 referrer of the course, not a copy of it: 358 358 -
main/waeup.kofa/trunk/src/waeup/kofa/university/course.py
r7811 r8920 78 78 # Remove that referrer... 79 79 cert = certcourse.__parent__ 80 cert.delC ourseRef(code)80 cert.delCertCourse(code) 81 81 cert._p_changed = True 82 82 return -
main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py
r8472 r8920 286 286 """ 287 287 course = schema.Choice( 288 title = _(u'Course Referrer'),288 title = _(u'Course'), 289 289 source = CourseSource(), 290 290 readonly = True, -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py
r7811 r8920 266 266 self.department2.certificates['CRT'] = self.certificate 267 267 self.course = Course(code='CRS') 268 self.department2.certificates['CRT'].addC ourseRef(self.course)268 self.department2.certificates['CRT'].addCertCourse(self.course) 269 269 self.cert_course = self.certificate['CRS_100'] 270 270 self.department2.courses['CRS'] = self.course -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_export.py
r8303 r8920 444 444 self.dept1.certificates.addCertificate(self.cert2) 445 445 self.dept2.certificates.addCertificate(self.cert3) 446 self.cert1.addC ourseRef(self.course1, 100, True)447 self.cert1.addC ourseRef(self.course2, 400, False)448 self.cert3.addC ourseRef(self.course3, 100, False)446 self.cert1.addCertCourse(self.course1, 100, True) 447 self.cert1.addCertCourse(self.course2, 400, False) 448 self.cert3.addCertCourse(self.course3, 100, False) 449 449 self.certcourse1 = self.cert1['C1_100'] 450 450 self.certcourse2 = self.cert1['C2_400'] -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_university.py
r7811 r8920 33 33 def test_suite(): 34 34 # collect doctests for university subpackage 35 suite = get_doctest_suite(['university/c ourserefs.txt',])35 suite = get_doctest_suite(['university/certcourses.txt',]) 36 36 # add local unittests (actually only one) 37 37 for testcase in [UniversitySubpackageTests,]:
Note: See TracChangeset for help on using the changeset viewer.