Changeset 4273
- Timestamp:
- 13 Jun 2009, 11:35:46 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/app.txt
r3933 r4273 1 waeup.app 2 ********* 3 4 Base components for a WAeUP portal. 1 :mod:`waeup.app` -- central components for a WAeUP portal 2 ********************************************************* 5 3 6 4 :Test-Layer: unit 7 5 8 The main WAeUP application object is given with `University`. It 9 provides the main containers as faculties, hostels, etc. 6 .. module:: waeup.app 7 8 .. class:: University 9 10 The main WAeUP application object is given with 11 :class:`University`. It provides the main containers as faculties, 12 hostels, etc. 13 14 .. attribute:: name 15 16 A string. The name of a university. 17 18 .. attribute:: faculties 19 20 An arbitrary object containing "faculties". In the case of 21 `University` it is a container of type 22 `waeup.interfaces.IFacultyContainer`. 23 10 24 11 25 Creating `University` instances 12 26 =============================== 13 27 14 As `University` instances make use of the Zope Component Architecture 15 (ZCA), we have to setup the basic component registries, before we can 16 create instances. We do this by simply grokking the whole `waeup` 17 package. This way all interfaces, utilities and adapters defined in 18 the package are looked up and registered with the global registries:: 28 As :class:`University` instances make use of the Zope Component 29 Architecture (ZCA), we have to setup the basic component registries, 30 before we can create instances. We do this by simply grokking the 31 whole :mod:`waeup` package. This way all interfaces, utilities and adapters 32 defined in the package are looked up and registered with the global 33 registries: 19 34 20 35 >>> import grok 21 36 >>> grok.testing.grok('waeup') 22 37 23 Now we can import the `University` class and create an instence:: 38 Now we can import the :class:`University` class and create an 39 instance: 24 40 25 41 >>> from waeup.app import University … … 29 45 30 46 Instances of `University` comply with the interface 31 `waeup.interfaces.IUniversity`: :47 `waeup.interfaces.IUniversity`: 32 48 33 49 >>> from zope.interface.verify import verifyClass … … 36 52 True 37 53 38 University attributes 39 ===================== 40 41 Instances of University provide some attributes as described in the 42 `IUniversity` interface: 43 44 ``name`` 45 A string. The name of a university. 46 47 ``faculties`` 48 An arbitrary object containing "faculties". In the case of 49 `University` it is a container of type 50 `waeup.interfaces.IFacultyContainer`. 51 52 A freshly created instance provides these attributes:: 54 A freshly created instance provides the attributes promised by the 55 interface: 53 56 54 57 >>> from waeup.app import University
Note: See TracChangeset for help on using the changeset viewer.