[doc] Add a little to views chapter.
authorSandrine Ribeau <sandrine.ribeau@logilab.fr>
Fri, 02 Jan 2009 14:48:43 -0800
changeset 318 6cb74102d611
parent 317 cf1c6178b322
child 319 00ada106b138
[doc] Add a little to views chapter.
doc/book/en/B1020-define-views.en.txt
--- a/doc/book/en/B1020-define-views.en.txt	Wed Dec 31 16:34:54 2008 +0100
+++ b/doc/book/en/B1020-define-views.en.txt	Fri Jan 02 14:48:43 2009 -0800
@@ -117,6 +117,44 @@
 
 .. include:: B1022-views-stdlib.en.txt
 
+
+Examples of views class 
+-----------------------
+
+- Using the attribute `templatable`
+
+  ::
+    
+
+    class RssView(XmlView):
+        id = 'rss'
+        title = _('rss')
+        templatable = False
+        content_type = 'text/xml'
+        http_cache_manager = MaxAgeHTTPCacheManager
+        cache_max_age = 60*60*2 # stay in http cache for 2 hours by default
+    
+
+
+- Using the attribute `__selectors__`
+
+  ::
+    
+
+    class SearchForAssociationView(EntityView):
+        """view called by the edition view when the user asks
+        to search for something to link to the edited eid
+        """
+        id = 'search-associate'
+        title = _('search for association')
+        __selectors__ = (one_line_rset, match_search_state, accept_selector)
+        accepts = ('Any',)
+        search_states = ('linksearch',)
+
+    
+
+
+
 Example of a view customization
 -------------------------------