Changeset 4312 for waeup/branches
- Timestamp:
- 18 Jun 2009, 11:27:25 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/university/certificate.txt
r4290 r4312 6 6 Creating certificates 7 7 ===================== 8 9 Because certificates make use of components registered with the Zope 10 Component Architecture (ZCA), we first have to grok the `waeup` 11 package. This happens automatically in real-world use: 12 13 >>> import grok 14 >>> grok.testing.grok('waeup') 8 15 9 16 We can create certificates: … … 15 22 16 23 Another way to create certificates is by asking for a factory called 17 ``waeup.Certificate``. Before we can do this, we have to grok the `waeup` 18 package. This happens automatically in real-world use: 19 20 >>> import grok 21 >>> grok.testing.grok('waeup') 22 23 Now we can create a factory without importing a class: 24 ``waeup.Certificate``. This way we can create a factory without 25 importing a class: 24 26 25 27 >>> from zope.component import createObject … … 28 30 <waeup.university.certificate.Certificate object at 0x...> 29 31 32 30 33 Certificate attributes 31 ================== 34 ====================== 32 35 33 36 Certificates have the attributes required by the `ICertificate` interface: … … 59 62 >>> mycertificate.code 60 63 u'NA' 64 65 `review_state` 66 -------------- 67 68 The review state can have one of the ``checking`` states defined in 69 the WAeUP workflow. These are at least the states ``checked`` and 70 ``unchecked``. After a certificate is created, the review state is 71 ``unchecked``: 72 73 >>> mycertificate.review_state 74 'unchecked' 75 76 We can mark a certificate as checked: 77 78 >>> mycertificate.check() 79 >>> mycertificate.review_state 80 'checked' 81 82 We cannot uncheck a certificate: 83 84 >>> mycertificate.review_state = 'init'
Note: See TracChangeset for help on using the changeset viewer.