doc/tutorials/base/customizing-the-application.rst
changeset 12925 eb26c593c6f6
parent 12924 7a76f1fcc4a3
equal deleted inserted replaced
12924:7a76f1fcc4a3 12925:eb26c593c6f6
   389 
   389 
   390         def dc_title(self):
   390         def dc_title(self):
   391             return self.name
   391             return self.name
   392 
   392 
   393         def display_cw_logo(self):
   393         def display_cw_logo(self):
   394             return 'CubicWeb' in self.description
   394             return 'CubicWeb' in self.name
   395 
   395 
   396 In this example:
   396 In this example:
   397 
   397 
   398 * we used convenience :func:`fetch_config` function to tell which attributes
   398 * we used convenience :func:`fetch_config` function to tell which attributes
   399   should be prefetched by the ORM when looking for some related entities of this
   399   should be prefetched by the ORM when looking for some related entities of this
   401 
   401 
   402 * we overrode the standard `dc_title` method, used in various place in the interface
   402 * we overrode the standard `dc_title` method, used in various place in the interface
   403   to display the entity (though in this case the default implementation would
   403   to display the entity (though in this case the default implementation would
   404   have had the same result)
   404   have had the same result)
   405 
   405 
   406 * we implemented here a method :meth:`display_cw_logo` which tests if the blog
   406 * we implemented here a method :meth:`display_cw_logo` which tests if the
   407   entry title contains 'CubicWeb'. It can then be used when you're writing code
   407   community title contains 'CubicWeb'. It can then be used when you're writing
   408   involving 'Community' entities in your views, hooks, etc. For instance, you can
   408   code involving 'Community' entities in your views, hooks, etc. For instance,
   409   modify your previous views as follows:
   409   you can modify your previous views as follows:
   410 
   410 
   411 .. sourcecode:: python
   411 .. sourcecode:: python
   412 
   412 
   413 
   413 
   414   class CommunityPrimaryView(primary.PrimaryView):
   414   class CommunityPrimaryView(primary.PrimaryView):