- Timestamp:
- 28 Jun 2009, 00:09:56 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/university/certificate.txt
r4384 r4386 245 245 >>> certificate_factory.getInterfaces() 246 246 <implementedBy waeup.university.certificate.Certificate> 247 248 249 :class:`CertificateCourseFactory` 250 --------------------------------- 251 252 .. class:: CertificateCourseFactory() 253 254 .. attribute:: grok.name(u'waeup.CertificateCourse') 255 256 .. attribute:: grok.implements(IFactory) 257 258 A named utility to deliver new instances of :class:`CertificateCourse` 259 without the need to import the implementation before: 260 261 >>> from zope.component import createObject 262 >>> mycertificatecourse = createObject(u'waeup.CertificateCourse') 263 >>> mycertificatecourse 264 <waeup.university.certificate.CertificateCourse object at 0x...> 265 266 The factory complies with the specifications from the 267 :class:`IFactory` insterface: 268 269 >>> from zope.interface.verify import verifyClass 270 >>> from zope.component.interfaces import IFactory 271 >>> from waeup.university.certificate import CertificateCourseFactory 272 >>> verifyClass(IFactory, CertificateCourseFactory) 273 True 274 275 This means also, that we can get the interfaces of the created 276 object from the factory: 277 278 >>> certcourse_factory = CertificateCourseFactory() 279 >>> certcourse_factory.getInterfaces() 280 <implementedBy waeup.university.certificate.CertificateCourse> 247 281 248 282
Note: See TracChangeset for help on using the changeset viewer.