doc/book/en/intro/tutorial/components.rst
changeset 2476 1294a6bdf3bf
parent 2280 31269a9b9ec4
child 2533 07a744f64c2e
equal deleted inserted replaced
2475:b6753521129d 2476:1294a6bdf3bf
     9 ~~~~~~~~~~~~~~~~
     9 ~~~~~~~~~~~~~~~~
    10 
    10 
    11 A library of standard cubes are available from `CubicWeb Forge`_
    11 A library of standard cubes are available from `CubicWeb Forge`_
    12 Cubes provide entities and views.
    12 Cubes provide entities and views.
    13 
    13 
    14 The available application entities are:
    14 The available application entities in standard cubes are:
    15 
    15 
    16 * addressbook: PhoneNumber and PostalAddress
    16 * addressbook: PhoneNumber and PostalAddress
    17 
    17 
    18 * basket: Basket (like a shopping cart)
    18 * basket: Basket (like a shopping cart)
    19 
    19 
    41 
    41 
    42 
    42 
    43 Adding comments to BlogDemo
    43 Adding comments to BlogDemo
    44 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    44 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    45 
    45 
    46 To import a cube in your application just change the line in the
    46 To import a cube in your instance just change the line in the
    47 ``__pkginfo__.py`` file and verify that the cube you are planning
    47 ``__pkginfo__.py`` file and verify that the cube you are planning
    48 to use is listed by the command ``cubicweb-ctl list``.
    48 to use is listed by the command ``cubicweb-ctl list``.
    49 For example::
    49 For example::
    50 
    50 
    51     __use__ = ('comment',)
    51     __use__ = ('comment',)
    52 
    52 
    53 will make the ``Comment`` entity available in your ``BlogDemo``
    53 will make the ``Comment`` entity available in your ``BlogDemo``
    54 application.
    54 cube.
    55 
    55 
    56 Change the schema to add a relationship between ``BlogEntry`` and
    56 Change the schema to add a relationship between ``BlogEntry`` and
    57 ``Comment`` and you are done. Since the comment cube defines the
    57 ``Comment`` and you are done. Since the comment cube defines the
    58 ``comments`` relationship, adding the line::
    58 ``comments`` relationship, adding the line::
    59 
    59 
    73 run the following command:
    73 run the following command:
    74 ::
    74 ::
    75 
    75 
    76   synchronize_rschema('BlogEntry')
    76   synchronize_rschema('BlogEntry')
    77 
    77 
    78 You can now start your application and add comments to each
    78 You can now start your instance and add comments to each `BlogEntry`.
    79 `BlogEntry`.