doc/book/en/development/devweb/views/primary.rst
branchstable
changeset 5362 e185d708a36f
parent 5312 d2dbba898a96
child 5388 9167751463d4
equal deleted inserted replaced
5351:ecf07370e6db 5362:e185d708a36f
   208 We'll show you now an example of a ``primary`` view and how to customize it.
   208 We'll show you now an example of a ``primary`` view and how to customize it.
   209 
   209 
   210 We continue along the basic tutorial :ref:`tuto_blog`.
   210 We continue along the basic tutorial :ref:`tuto_blog`.
   211 
   211 
   212 If you want to change the way a ``BlogEntry`` is displayed, just override
   212 If you want to change the way a ``BlogEntry`` is displayed, just override
   213 the method ``cell_call()`` of the view ``primary`` in ``BlogDemo/views.py``:
   213 the method ``cell_call()`` of the view ``primary`` in ``BlogDemo/views.py``.
   214 
   214 
   215 .. sourcecode:: python
   215 .. sourcecode:: python
   216 
   216 
   217   from cubicweb.selectors import implements
   217   from cubicweb.selectors import implements
   218   from cubicweb.web.views.primary improt Primaryview
   218   from cubicweb.web.views.primary import Primaryview
   219 
   219 
   220   class BlogEntryPrimaryView(PrimaryView):
   220   class BlogEntryPrimaryView(PrimaryView):
   221     __select__ = PrimaryView.__select__ & implements('BlogEntry')
   221     __select__ = PrimaryView.__select__ & implements('BlogEntry')
   222 
   222 
   223       def render_entity_attributes(self, entity):
   223       def render_entity_attributes(self, entity):