Ignore:
Timestamp:
28 Jun 2009, 00:02:27 (15 years ago)
Author:
uli
Message:

Test delCourseRef().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/university/certificate.txt

    r4332 r4383  
    399399As we can see, the course was also removed from the certificate.
    400400
     401We can of course also remove existing courses from certificates by
     402using :meth:`delCourseRef`. This will not remove the same course from
     403any course container:
     404
     405    >>> mycourses = newdbroot['mydept'].courses
     406    >>> mycert = newdbroot['mydept'].certificates['MYCERT']
     407    >>> mycourses.addCourse(mycourse)
     408    >>> mycert.addCourseRef(mycourse)
     409    >>> c1 = mycourses['MYCOURSE']
     410    >>> c2 = mycert['MYCOURSE'].course
     411    >>> c1 is c2
     412    True
     413
     414    >>> mycert.delCourseRef('MYCOURSE')
     415
     416The certificate now has no ``MYCOURSE`` course anymore, while the
     417courses container still has:
     418
     419    >>> 'MYCOURSE' in mycert.keys()
     420    False
     421
     422    >>> mycourses['MYCOURSE']
     423    <waeup.university.course.Course object at 0x...>
     424
    401425Clean up:
    402426
Note: See TracChangeset for help on using the changeset viewer.