# HG changeset patch # User Laurent Peuch # Date 1550771496 -3600 # Node ID dc793c6ebc486f0d38c747be47894b62ec33a375 # Parent e5610bdda5b27169e516860ba6a9b8f81c19628a [doc] always put file name for code example and uses :file:`path` syntax everywhere diff -r e5610bdda5b2 -r dc793c6ebc48 doc/tutorials/advanced/part01_create-cube.rst --- a/doc/tutorials/advanced/part01_create-cube.rst Thu Feb 21 18:49:24 2019 +0100 +++ b/doc/tutorials/advanced/part01_create-cube.rst Thu Feb 21 18:51:36 2019 +0100 @@ -96,6 +96,8 @@ Step 4: glue everything together in my cube's schema ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Put this code in :file:`cubicweb-sytweb/cubicweb_sytweb/schema.py`: + .. sourcecode:: python from yams.buildobjs import RelationDefinition diff -r e5610bdda5b2 -r dc793c6ebc48 doc/tutorials/advanced/part02_security.rst --- a/doc/tutorials/advanced/part02_security.rst Thu Feb 21 18:49:24 2019 +0100 +++ b/doc/tutorials/advanced/part02_security.rst Thu Feb 21 18:51:36 2019 +0100 @@ -55,7 +55,7 @@ * security propagation will be done in hook. -So the first thing to do is to modify my cube's schema.py to define those +So the first thing to do is to modify my cube's :file:`schema.py` to define those relations: .. sourcecode:: python @@ -96,7 +96,7 @@ by default, which somewhat breaks our security model... Now, we should be able to define security rules in the schema, based on these new -attribute and relation. Here is the code to add to *schema.py*: +attribute and relation. Here is the code to add to :file:`schema.py`: .. sourcecode:: python @@ -184,7 +184,7 @@ * when a "parent" relation is added, propagate parent's visibility unless the child already has a visibility set -Here is the code in cube's *hooks.py*: +Here is the code in cube's :file:`hooks.py`: .. sourcecode:: python @@ -251,7 +251,7 @@ Now, we also want to propagate the `may_be_read_by` relation. Fortunately, CubicWeb provides some base hook classes for such things, so we only have to add -the following code to *hooks.py*: +the following code to :file:`hooks.py`: .. sourcecode:: python @@ -419,10 +419,10 @@ don't want to create a new one, but to migrate the existing one. Let's see how to do that. -Migration commands should be put in the cube's *migration* directory, in a file named file:`_Any.py` ('Any' being there mostly for historical reasons). +Migration commands should be put in the cube's :file:`migration` directory, in a -Here I'll create a *migration/0.2.0_Any.py* file containing the following +Here I'll create a :file:`migration/0.2.0_Any.py` file containing the following instructions: .. sourcecode:: python @@ -431,7 +431,7 @@ add_relation_type('visibility') sync_schema_props_perms() -Then I update the version number in the cube's *__pkginfo__.py* to 0.2.0. And +Then I update the version number in the cube's :file:`__pkginfo__.py` to 0.2.0. And that's it! Those instructions will: * update the instance's schema by adding our two new relations and update the diff -r e5610bdda5b2 -r dc793c6ebc48 doc/tutorials/advanced/part03_bfss.rst --- a/doc/tutorials/advanced/part03_bfss.rst Thu Feb 21 18:49:24 2019 +0100 +++ b/doc/tutorials/advanced/part03_bfss.rst Thu Feb 21 18:51:36 2019 +0100 @@ -12,7 +12,7 @@ Since the function to register a custom storage needs to have a repository instance as first argument, we've to call it in a server startup hook. So I added -in `cubicweb_sytweb/hooks.py` : +in :file:`cubicweb_sytweb/hooks.py` : .. sourcecode:: python diff -r e5610bdda5b2 -r dc793c6ebc48 doc/tutorials/advanced/part04_ui-base.rst --- a/doc/tutorials/advanced/part04_ui-base.rst Thu Feb 21 18:49:24 2019 +0100 +++ b/doc/tutorials/advanced/part04_ui-base.rst Thu Feb 21 18:51:36 2019 +0100 @@ -19,7 +19,7 @@ * customize the 404 page, proposing to login to anonymous. -Here is the code, samples from my cube's `views.py` file: +Here is the code, samples from my cube's :file:`views.py` file: .. sourcecode:: python @@ -80,6 +80,8 @@ simpler index page that simply list available folders (e.g. photo albums in that site). +Here is the code, samples from my cube's :file:`views.py` file: + .. sourcecode:: python from cubicweb.web.views import startup diff -r e5610bdda5b2 -r dc793c6ebc48 doc/tutorials/base/customizing-the-application.rst --- a/doc/tutorials/base/customizing-the-application.rst Thu Feb 21 18:49:24 2019 +0100 +++ b/doc/tutorials/base/customizing-the-application.rst Thu Feb 21 18:51:36 2019 +0100 @@ -308,7 +308,7 @@ details in :ref:`primary_view`). -So... Some code! That we'll put again in the module ``views`` (``myblog/views.py``) of our cube. +So... Some code! That we'll put again in the module ``views`` (:file:`myblog/views.py`) of our cube. .. sourcecode:: python @@ -383,7 +383,7 @@ - defines a :attr:`__regid__` linked to the corresponding data type of your schema You may then want to add your own methods, override default implementation of some -method, etc... To do so, write this code in ``myblog/entities.py``: +method, etc... To do so, write this code in :file:`myblog/entities.py`: .. sourcecode:: python @@ -519,7 +519,7 @@ custom rendering but also extension points provided by the default implementation. -In ``myblog/views.py``: +In :file:`myblog/views.py`: .. sourcecode:: python