Changeset 5978 for main/waeup.sirp
- Timestamp:
- 26 Apr 2011, 10:44:43 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/batchprocessing.txt
r5947 r5978 286 286 >>> open('certificates.csv', 'wb').write( 287 287 ... """code,faculty_code,department_code,title,study_mode,start_level,end_level,application_category 288 ... CERT1,FAC1,DEP1,Certificate 1,uf_ft,100,30 ,basic289 ... CERT2,FAC1,DEP1,Certificate 2,uf_ft,200,30 ,cest288 ... CERT1,FAC1,DEP1,Certificate 1,uf_ft,100,300,basic 289 ... CERT2,FAC1,DEP1,Certificate 2,uf_ft,200,300,cest 290 290 ... """) 291 291 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r5954 r5978 485 485 486 486 >>> browser.getControl(name='form.study_mode').value = 'combined' 487 >>> browser.getControl(name='form.start_level').value = '100'488 >>> browser.getControl(name='form.end_level').value = '400'487 >>> browser.getControl(name='form.start_level').value = ['100'] 488 >>> browser.getControl(name='form.end_level').value = ['400'] 489 489 >>> browser.getControl(name='form.application_category').value = 'UME' 490 490 … … 501 501 >>> browser.getControl(name='form.code').value = 'CERT1' 502 502 >>> browser.getControl(name='form.study_mode').value = 'combined' 503 >>> browser.getControl(name='form.start_level').value = '100'504 >>> browser.getControl(name='form.end_level').value = '400'503 >>> browser.getControl(name='form.start_level').value = ['100'] 504 >>> browser.getControl(name='form.end_level').value = ['400'] 505 505 >>> browser.getControl(name='form.application_category').value = 'UME' 506 506 … … 596 596 597 597 Once we have a certificate, we can add also certificate courses. These 598 are refer ences tocourses with some extra data.598 are referrers of courses with some extra data. 599 599 600 600 Before we can work with certificate courses, we need some certificates … … 621 621 >>> browser.getControl(name='form.title').value = 'Certificate 1' 622 622 >>> browser.getControl(name='form.study_mode').value = 'combined' 623 >>> browser.getControl(name='form.start_level').value = '100'624 >>> browser.getControl(name='form.end_level').value = '400'623 >>> browser.getControl(name='form.start_level').value = ['100'] 624 >>> browser.getControl(name='form.end_level').value = ['400'] 625 625 >>> browser.getControl(name='form.application_category').value = 'UME' 626 626 >>> browser.getControl('Add certificate').click() … … 632 632 >>> browser.getControl(name='form.title').value = 'Certificate 2' 633 633 >>> browser.getControl(name='form.study_mode').value = 'combined' 634 >>> browser.getControl(name='form.start_level').value = '100'635 >>> browser.getControl(name='form.end_level').value = '400'634 >>> browser.getControl(name='form.start_level').value = ['100'] 635 >>> browser.getControl(name='form.end_level').value = ['400'] 636 636 >>> browser.getControl(name='form.application_category').value = 'UME' 637 637 >>> browser.getControl('Add certificate').click() … … 644 644 with their code as key. 645 645 646 Each certificate provides a ``Add course `` action button near top.646 Each certificate provides a ``Add course referrer`` action button near top. 647 647 648 648 Certificates provide an add-form to add new certcourses: … … 666 666 667 667 >>> ctrl.getControl('COURSE1').selected = True 668 >>> browser.getControl('Add course').click() 668 >>> browser.getControl(name='form.level').value = ['100'] 669 >>> browser.getControl('Add course referrer').click() 669 670 670 671 Our certificatecourse will be linked on the parent certificate page: 671 672 672 673 >>> browser.open(cert_url) 673 >>> browser.getLink('COURSE1 ').click()674 >>> browser.getLink('COURSE1_100').click() 674 675 >>> browser.url 675 676 'http://localhost/my...sity/faculties/TF/TD/certificates/CERT1/COURSE1_100' … … 692 693 693 694 >>> browser.open(cert_url + '/COURSE1_100') 694 >>> browser.getLink('Edit course refer ence').click()695 >>> browser.getLink('Edit course referrer').click() 695 696 696 697 Let's set a new level (it was 100 before) and save the form. This will 697 698 bring us to the certificate index page afterwards: 698 699 699 >>> browser.getControl(name='form.level').value = "200"700 >>> browser.getControl(name='form.level').value = ['200'] 700 701 >>> ctrl = browser.getControl("Save and return") 701 702 >>> ctrl.click() … … 703 704 As we changed the level, also the URL will change: 704 705 705 >>> browser.getLink('COURSE1 ').click()706 >>> browser.getLink('COURSE1_200').click() 706 707 >>> browser.url 707 708 'http://localhost/myun.../TF/TD/certificates/CERT1/COURSE1_200' … … 710 711 changed: 711 712 712 >>> browser.getLink('Edit course refer ence').click()713 >>> browser.getControl(name='form.level').value = "666"713 >>> browser.getLink('Edit course referrer').click() 714 >>> browser.getControl(name='form.level').value = ['400'] 714 715 >>> browser.getControl('Cancel').click() 715 716 716 Our certcourse provides a new level of 200 and not 666:717 Our certcourse provides a new level of 200 and not 400: 717 718 718 719 >>> browser.open(cert_url + '/COURSE1_200') -
main/waeup.sirp/trunk/src/waeup/sirp/university/api.txt
r4975 r5978 22 22 facultycontainer.txt 23 23 24 Additional infos about the refer ences tocourses and how they are24 Additional infos about the referrers of courses and how they are 25 25 handled can be found in: 26 26 -
main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.txt
r5949 r5978 98 98 .. method:: addCourseRef(course[, level=100,[ core_or_elective=True]]) 99 99 100 Add a refer ence toa course. A course is an object implementing100 Add a referrer of a course. A course is an object implementing 101 101 :class:`waeup.sirp.interfaces.ICourse`. 102 102 103 Please don't be confused by the term 'reference'. This just 104 means an ordinary :class:`waeup.sirp.university.course.Course` object 105 in almost all cases. As this object will normaly be one stored 106 in a department, the course here will simply become a reference 107 to the 'real' one in the department container. 103 Please don't be confused by the term 'referrer'. As course objects 104 will normaly be stored 105 in a department, the course referrer refers to 106 the 'real' course in the department container. 108 107 109 108 .. method:: delCourseRef(code) 110 109 111 Remove a course from a certificate.112 113 The coursemust be given by its code number.110 Remove a course referrer from a certificate. 111 112 The referrer must be given by its code number. 114 113 115 114 :class:`CertificateCourse` … … 118 117 .. class:: CertificateCourse(course[, level=100[, core_or_elective=True]]) 119 118 120 Create a certificate course. 121 122 A certificate-course is a course (:class:`Course`) which is part of 123 a certificate. Normally, certificate-courses are held in 119 Create a course referrer. 120 121 A certificate course (old term) or course referrer are held in 124 122 certificates and refer to an existing :class:`Course` instance held 125 123 elsewhere. 126 124 127 A certificate can require several course s and one128 course can be required by several certificates.125 A certificate can require several course referrers and one 126 course referrer can be required by several certificates. 129 127 130 128 .. attribute:: course … … 223 221 instance is removed from a container. 224 222 225 Tries to remove all refer encing :class:`CertificateCourse`226 instances that refer ence theremoved course.223 Tries to remove all referring :class:`CertificateCourse` 224 instances that refer to a removed course. 227 225 228 226 To accomplish that, the parents of the removed course are looked up 229 for a certifcate container which contains a c ertificate-coursethat230 contains a referenceto the deleted course.227 for a certifcate container which contains a course referrer that 228 refers to the deleted course. 231 229 232 230 .. seealso:: :ref:`removecertificatecourses` … … 290 288 291 289 If a certificate course requires a certain course and this is course 292 is deleted, also the refer encing certificate course is deleted.290 is deleted, also the referring certificate course is deleted. 293 291 294 292 We setup a data structure that reflects typical usage. It looks like … … 356 354 ['mydept'] 357 355 358 The c ertificate-coursewe stored in the certificate is indeed a359 refer ence tothe course, not a copy of it:356 The course referrer we stored in the certificate is indeed a 357 referrer of the course, not a copy of it: 360 358 361 359 >>> course = newdbroot['mydept'].courses['MYCOURSE'] -
main/waeup.sirp/trunk/src/waeup/sirp/university/courserefs.txt
r4921 r5978 1 Course refer ences2 **************** *1 Course referrers 2 **************** 3 3 4 Courses are refer encedby certificate courses.4 Courses are referred to by certificate courses. 5 5 6 6 :Test-Layer: functional 7 7 8 We can be sure, that when removing courses or refer ences tothem,8 We can be sure, that when removing courses or referrers of them, 9 9 other data will be handled in a way we expect. That is, 10 10 11 * when we remove a course, we want all refer ences to it be removed as11 * when we remove a course, we want all referrers to it be removed as 12 12 well 13 13 14 * when we remove a refer ence toa course, nothing else should be15 touched but only this very refer ence.14 * when we remove a referrer of a course, nothing else should be 15 touched but only this very referrer. 16 16 17 17 18 As correct deletion of refer encesneeds support of catalogs (we lookup19 catalogs to find refer ences), we need a fully blown ZODB here,18 As correct deletion of referrer needs support of catalogs (we lookup 19 catalogs to find referrers), we need a fully blown ZODB here, 20 20 including an instance of :class:`waeup.sirp.app.University`, as this is our 21 21 `ISite` object where the catalogs are stored. … … 59 59 >>> fac['DEPT2'].courses.addCourse(course) 60 60 61 Finally, we add a certificate with refer ences (certificate courses) to61 Finally, we add a certificate with referrers (certificate courses) to 62 62 the created courses: 63 63 … … 77 77 ... fac['DEPT2'].courses['CRS2'], level=200) 78 78 79 So, we have three refer ences in our certificate totwo different79 So, we have three referrers in our certificate of two different 80 80 courses stored somewhere in the application: 81 81 … … 83 83 [u'CRS1_100', u'CRS2_100', u'CRS2_200'] 84 84 85 Both, the courses themselves and the refer ences tothem, are the same85 Both, the courses themselves and the referrers of them, are the same 86 86 (not only equal): 87 87 … … 92 92 True 93 93 94 If we remove the course, also the reference to it in the certcourse94 If we remove the course, also the select item in the certificate course 95 95 will be gone: 96 96 … … 108 108 [] 109 109 110 If we remove a refer ence, this will not touch the referencedcourse111 nor other refer ences:110 If we remove a referrer of a course, this will not touch the course 111 nor other referrers: 112 112 113 113 >>> del fac['DEPT'].certificates['CERT']['CRS2_200']
Note: See TracChangeset for help on using the changeset viewer.