doc/book/en/A02a-create-cube.en.txt
changeset 280 ce829abf7c29
parent 272 06077d56f2c4
child 296 65564e83853e
equal deleted inserted replaced
277:a11a3c231050 280:ce829abf7c29
    57   |   |-- pytestconf.py
    57   |   |-- pytestconf.py
    58   |   |-- realdb_test_blog.py
    58   |   |-- realdb_test_blog.py
    59   |   `-- test_blog.py
    59   |   `-- test_blog.py
    60   |
    60   |
    61   `-- views.py
    61   `-- views.py
       
    62 
       
    63 .. note::
       
    64   You will find a more detailled description of the `cube` concept in
       
    65   :ref:`cubesConcepts`.
    62 
    66 
    63 .. _DefineDataModel:
    67 .. _DefineDataModel:
    64 
    68 
    65 Define your data model
    69 Define your data model
    66 ----------------------
    70 ----------------------
   218 .. _DefineViews:
   222 .. _DefineViews:
   219 
   223 
   220 Define your entities views
   224 Define your entities views
   221 --------------------------
   225 --------------------------
   222 
   226 
       
   227 Each entity defined in a model inherits defaults views allowing
       
   228 different rendering of the data. You can redefine each of them
       
   229 according to your needs and preferences. If you feel like it then
       
   230 you have to know how a view is defined.
       
   231 
       
   232 
   223 The views selection principle
   233 The views selection principle
   224 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   234 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   225 
   235 
   226 A view is defined by a Python class which includes: 
   236 A view is defined by a Python class which includes: 
   227   
   237   
   228   - an identifier (all objects in `CubicWeb` are entered in a registry
   238   - an identifier (all objects in `CubicWeb` are entered in a registry
   229     and this identifier will be used as a key)
   239     and this identifier will be used as a key)
   230   
   240   
   231   - a filter to select the resulsets it can be applied to
   241   - a filter to select the resulsets it can be applied to
   232 
   242 
       
   243 A view has a set of methods complying
       
   244 with the `View` class interface (`cubicweb.common.view`).
   233 
   245 
   234 `CubicWeb` provides a lot of standard views for the type
   246 `CubicWeb` provides a lot of standard views for the type
   235 `EntityView`, for a complete list, you
   247 `EntityView`, for a complete list, you
   236 will have to read the code in directory ``cubicweb/web/views/``
   248 will have to read the code in directory ``cubicweb/web/views/``
   237 
   249