Changeset 12951 for main/waeup.kofa/trunk/src/waeup/kofa/doctests
- Timestamp:
- 15 May 2015, 08:56:17 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/doctests
- Files:
-
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/doctests/app.txt
r12948 r12951 1 :mod:`waeup.kofa.app` -- central components for Kofa 2 ****************** **********************************1 Central Components 2 ****************** 3 3 4 4 .. :doctest: … … 6 6 7 7 .. module:: waeup.kofa.app 8 9 .. class:: University10 11 The main Kofa application object is given with12 :class:`University`. It provides the main containers as faculties,13 hostels, etc.14 15 .. attribute:: name16 17 A string. The name of a university.18 19 .. attribute:: faculties20 21 An arbitrary object containing "faculties". In the case of22 `University` it is a container of type23 `waeup.kofa.interfaces.IFacultiesContainer`.24 8 25 9 … … 37 21 instance: 38 22 39 40 41 42 23 >>> from waeup.kofa.app import University 24 >>> myuniversity = University() 25 >>> myuniversity 26 <waeup.kofa.app.University object at 0x...> 43 27 44 28 Instances of `University` comply with the interface 45 29 `waeup.kofa.interfaces.IUniversity`: 46 30 47 48 49 50 31 >>> from zope.interface.verify import verifyClass 32 >>> from waeup.kofa.interfaces import IUniversity 33 >>> verifyClass(IUniversity, University) 34 True 51 35 52 36 A freshly created instance provides the attributes promised by the 53 37 interface: 54 38 55 56 57 58 39 >>> from waeup.kofa.app import University 40 >>> myuniversity = University() 41 >>> myuniversity['configuration'].name 42 u'Sample University' 59 43 60 61 44 >>> myuniversity['faculties'] 45 <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...> 62 46 63 47 >>> myuniversity['students'] -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/authentication.txt
r12948 r12951 1 Kofa authentication2 ************** *****1 Authentication 2 ************** 3 3 4 4 We need to protect most pieces of our portals from unauthenticated … … 24 24 >>> browser.handleErrors = False 25 25 26 Creating users (principals)27 ================= ==========26 Creating officers 27 ================= 28 28 29 29 Before we can login, we have to provide a user (``principal`` in Zope … … 42 42 See ``userscontainer.txt`` for details about the UsersContainer we use here. 43 43 44 Users and local roles45 ===================== 44 Officers and local roles 45 ======================== 46 46 47 47 Accounts also hold infos about local roles assigned to a user. In the -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/catalog.txt
r12948 r12951 10 10 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 11 11 12 The KofaQuery Class13 ===================14 15 .. class:: KofaQuery()16 17 .. attribute:: grok.implements(hurry.query.interfaces.IQuery)18 19 A `hurry.query.query.Query` compatible query that also supports20 retrival of plain ``Bree`` result sets as used inside a catalog.21 22 Like `hurry.query.query.Query` objects, `KofaQuery` is some kind23 of a meta query or 'compound query' that can give the cataloged24 objects (or their int ids) matching one or more 'subqueries'.25 26 This way you can search for objects (or their int ids) that match27 several criteria at the same time. See ``examples`` section below.28 29 A singleton instance of this class is also available as global30 utility.31 32 .. method:: searchResults(query)33 34 Get the cataloged objects determined by ``query``.35 36 .. method:: apply(query)37 38 Get the list of int ids (a `BTree` result set) for objects39 determined by ``query``.40 41 The list of int ids is less expensive to compute than the42 complete search results and sufficient, for instance, when you43 only need the number of objects that match a query and not the44 objects themselves.45 46 Examples47 ========48 49 12 Getting a general query object 50 ------------------------------ 13 ============================== 51 14 52 15 We can get a KofaQuery object by asking for an unnamed global utility … … 64 27 65 28 Setting up a catalog and feeding it 66 ----------------------------------- 29 =================================== 67 30 68 31 >>> from zope.catalog.interfaces import ICatalog … … 143 106 144 107 Searching for result sets 145 ------------------------- 108 ========================= 146 109 147 110 Finally we can perform queries: … … 193 156 194 157 Searching for objects 195 --------------------- 158 ===================== 196 159 197 160 Very often we don't want to know the catalog-internal 'ids' of -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/certificatescontainer.txt
r12949 r12951 1 :mod:`waeup.kofa.university.certificatescontainer` -- Certificate containers2 ********************** ******************************************************1 Certificate Containers 2 ********************** 3 3 4 4 .. module:: waeup.kofa.university.certificatescontainer -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/course.txt
r12949 r12951 1 :mod:`waeup.kofa.university.course` --Courses2 ******* ***************************************1 Courses 2 ******* 3 3 4 4 .. module:: waeup.kofa.university.course -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/coursescontainer.txt
r12949 r12951 1 :mod:`waeup.kofa.university.coursescontainer` -- Course containers2 ***************** *************************************************1 Course Containers 2 ***************** 3 3 4 4 .. module:: waeup.kofa.university.coursescontainer -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/department.txt
r12949 r12951 1 :mod:`waeup.kofa.university.department` --Departments2 *********** *******************************************1 Departments 2 *********** 3 3 4 4 .. module:: waeup.kofa.university.department -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/facultiescontainer.txt
r12949 r12951 1 :mod:`waeup.kofa.university.facultiescontainer` --Faculty Containers2 ****************** ***************************************************1 Faculty Containers 2 ****************** 3 3 4 4 .. module:: waeup.kofa.university.facultiescontainer -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/faculty.txt
r12949 r12951 1 :mod:`waeup.kofa.university.faculty` --Faculties2 ********* ****************************************1 Faculties 2 ********* 3 3 4 4 .. module:: waeup.kofa.university.faculty -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/helpers.txt
r12939 r12951 1 :mod:`waeup.kofa.utils.helpers` --Helpers for Kofa2 **************** ***********************************1 Helpers for Kofa 2 **************** 3 3 4 4 .. module:: waeup.kofa.utils.helpers
Note: See TracChangeset for help on using the changeset viewer.