[doc/book] misc fixes/enhancements & notes stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 13 Apr 2010 19:22:46 +0200
branchstable
changeset 5231 40f53867e332
parent 5230 cd033d2f4229
child 5238 31c12863fd9d
child 5240 2af0427e8ead
[doc/book] misc fixes/enhancements & notes
doc/book/en/development/devrepo/hooks.rst
doc/book/en/development/devweb/request.rst
doc/book/en/development/migration.rst
doc/book/en/index.rst
--- a/doc/book/en/development/devrepo/hooks.rst	Tue Apr 13 19:21:20 2010 +0200
+++ b/doc/book/en/development/devrepo/hooks.rst	Tue Apr 13 19:22:46 2010 +0200
@@ -116,7 +116,9 @@
 Using dataflow Hooks
 --------------------
 
-XXX blabla
+Dataflow hooks either automate data operations or maintain the
+consistency of the data model. In the later case, we must use a
+specific exception named ValidationError
 
 Validation Errors
 ~~~~~~~~~~~~~~~~~
@@ -136,6 +138,8 @@
   an end-user facing message (hence properly translated) relating the
   problem.
 
+An entity hook
+~~~~~~~~~~~~~~
 
 We will use a very simple example to show hooks usage. Let us start
 with the following schema.
@@ -145,9 +149,6 @@
    class Person(EntityType):
        age = Int(required=True)
 
-An entity hook
-~~~~~~~~~~~~~~
-
 We would like to add a range constraint over a person's age. Let's
 write an hook. It shall be placed into mycube/hooks.py. If this file
 were to grow too much, we can easily have a mycube/hooks/... package
@@ -284,6 +285,8 @@
 
 .. sourcecode:: python
 
+   from cubicweb.server.hook import set_operation
+
    class CheckSubsidiaryCycleHook(Hook):
        __regid__ = 'check_no_subsidiary_cycle'
        events = ('after_add_relation',)
@@ -291,7 +294,7 @@
 
        def __call__(self):
            set_operation(self._cw, 'subsidiary_cycle_detection', self.eidto,
-                         CheckCycleOp, rtype=self.rtype)
+                         CheckSubsidiaryCycleOp, rtype=self.rtype)
 
    class CheckSubsidiaryCycleOp(Operation):
 
--- a/doc/book/en/development/devweb/request.rst	Tue Apr 13 19:21:20 2010 +0200
+++ b/doc/book/en/development/devweb/request.rst	Tue Apr 13 19:22:46 2010 +0200
@@ -1,5 +1,3 @@
-
-
 The `Request` class (`cubicweb.web`)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -57,3 +55,7 @@
 today). For the views or others that are executed on the server side,
 most of the interface of `Request` is defined in the session associated
 to the client.
+
+
+XXX autoclass !
+XXX create_entity
--- a/doc/book/en/development/migration.rst	Tue Apr 13 19:21:20 2010 +0200
+++ b/doc/book/en/development/migration.rst	Tue Apr 13 19:22:46 2010 +0200
@@ -74,12 +74,12 @@
   if the user answers yes, false otherwise (always returns true in
   non-interactive mode)
 
-* the function `_`, it is equivalent to `unicode` allowing to flag the strings
-  to internationalize in the migration scripts.
+* `_()` is equivalent to `unicode` allowing to flag the strings to
+  internationalize in the migration scripts.
 
 In the `repository` scripts, the following identifiers are also defined:
 
-* `checkpoint`, request confirming and executing a "commit" at checking point
+* `commit(ask_confirm=True)`, request confirming and executing a "commit"
 
 * `schema`, instance schema (readen from the database)
 
--- a/doc/book/en/index.rst	Tue Apr 13 19:21:20 2010 +0200
+++ b/doc/book/en/index.rst	Tue Apr 13 19:22:46 2010 +0200
@@ -44,7 +44,7 @@
 =================
 
 .. toctree::
-   :maxdepth: 2
+   :maxdepth: 3
 
    intro/index
    development/index
@@ -58,4 +58,4 @@
 * the :ref:`modindex`,
 * and the :ref:`search`.
 
-.. |cubicweb| replace:: *CubicWeb*
\ No newline at end of file
+.. |cubicweb| replace:: *CubicWeb*