[book] more id -> __regid__ stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 02 Mar 2010 19:15:26 +0100
branchstable
changeset 4751 1a9d2c3c7f0c
parent 4750 875dc33551a9
child 4752 2c2a9c53aea3
[book] more id -> __regid__
doc/book/en/development/devweb/facets.rst
doc/book/en/development/devweb/internationalization.rst
doc/book/en/development/devweb/views.rst
doc/book/en/development/webstdlib/basetemplates.rst
doc/book/en/development/webstdlib/primary.rst
doc/book/en/intro/tutorial/maintemplate.rst
--- a/doc/book/en/development/devweb/facets.rst	Tue Mar 02 19:11:46 2010 +0100
+++ b/doc/book/en/development/devweb/facets.rst	Tue Mar 02 19:15:26 2010 +0100
@@ -23,10 +23,10 @@
 The two other entity types defined in the schema are `Visit` and `Agency` but we
 can also guess from the above that this application uses the two cubes
 `comment`_ and
-`addressbook`_ (remember, cubicweb is only a game where you assemble cubes !). 
+`addressbook`_ (remember, cubicweb is only a game where you assemble cubes !).
 
 While we know that just defining the schema in enough to have a full, usable,
-(testable !) application, we also know that every application needs to be 
+(testable !) application, we also know that every application needs to be
 customized to fulfill the needs it was built for. So in this case, what we
 needed most was some custom filters that would let us restrict searches
 according
@@ -36,9 +36,9 @@
 
 .. sourcecode:: python
 
-  class PostalCodeFacet(RelationFacet): 
-      id = 'postalcode-facet'             # every registered class must have an id
-      __select__ = implements('Office')   # this facet should only be selected when 
+  class PostalCodeFacet(RelationFacet):
+      __regid__ = 'postalcode-facet'             # every registered class must have an id
+      __select__ = implements('Office')   # this facet should only be selected when
                                           # visualizing offices
       rtype = 'has_address'               # this facet is a filter on the entity linked to
                                           # the office thrhough the relation
@@ -57,18 +57,18 @@
 .. sourcecode:: python
 
   class SurfaceFacet(AttributeFacet):
-      id = 'surface-facet'              # every registered class must have an id
-      __select__ = implements('Office') # this facet should only be selected when 
+      __regid__ = 'surface-facet'              # every registered class must have an id
+      __select__ = implements('Office') # this facet should only be selected when
                                         # visualizing offices
-      rtype = 'surface'                 # the filter's key is the attribute "surface" 
-      comparator = '>='                 # override the default value of operator since 
+      rtype = 'surface'                 # the filter's key is the attribute "surface"
+      comparator = '>='                 # override the default value of operator since
                                         # we want to filter according to a
-                                        # minimal 
+                                        # minimal
                                         # value, not an exact one
 
       def rset_vocabulary(self, ___):
           """override the default vocabulary method since we want to hard-code
-          our threshold values. 
+          our threshold values.
           Not overriding would generate a filter box with all existing surfaces
           defined in the database.
           """
@@ -93,7 +93,7 @@
 We've just added two new kind of facets in CubicWeb :
 
 - The **RangeFacet** which displays a slider using `jquery`_
-  to choose a lower bound and an upper bound. The **RangeWidget** 
+  to choose a lower bound and an upper bound. The **RangeWidget**
   works with either numerical values or date values
 
 - The **HasRelationFacet** which displays a simple checkbox and
@@ -103,7 +103,7 @@
 .. image :: http://www.cubicweb.org/Image/343498?vid=download
 
 
-Here's an example of code that defines a facet to filter 
+Here's an example of code that defines a facet to filter
 musical works according to their composition date:
 
 .. sourcecode:: python
@@ -112,7 +112,7 @@
         # 1. make sure this facet is displayed only on Track selection
         __select__ = DateRangeFacet.__select__ & implements('Track')
         # 2. give the facet an id required by CubicWeb)
-        id = 'compdate-facet'
+        __regid__ = 'compdate-facet'
         # 3. specify the attribute name that actually stores the date in the DB
         rtype = 'composition_date'
 
--- a/doc/book/en/development/devweb/internationalization.rst	Tue Mar 02 19:11:46 2010 +0100
+++ b/doc/book/en/development/devweb/internationalization.rst	Tue Mar 02 19:15:26 2010 +0100
@@ -30,7 +30,7 @@
 
      class PrimaryView(EntityView):
          """the full view of an non final entity"""
-         id = 'primary'
+         __regid__ = 'primary'
          title = _('primary')
 
   OR
@@ -39,7 +39,7 @@
 
      class NoResultView(EmptyRsetView):
          """default view when no result has been found"""
-         id = 'noresult'
+         __regid__ = 'noresult'
 
          def call(self, **kwargs):
              self.w(u'<div class="searchMessage"><strong>%s</strong></div>\n'
--- a/doc/book/en/development/devweb/views.rst	Tue Mar 02 19:11:46 2010 +0100
+++ b/doc/book/en/development/devweb/views.rst	Tue Mar 02 19:15:26 2010 +0100
@@ -88,7 +88,7 @@
 .. sourcecode:: python
 
     class RSSView(XMLView):
-        id = 'rss'
+        __regid__ = 'rss'
         title = _('rss')
         templatable = False
         content_type = 'text/xml'
@@ -104,7 +104,7 @@
         """view called by the edition view when the user asks
         to search for something to link to the edited eid
         """
-        id = 'search-associate'
+        __regid__ = 'search-associate'
         title = _('search for association')
         __select__ = one_line_rset() & match_search_state('linksearch') & implements('Any')
 
@@ -152,7 +152,7 @@
  from cubicweb.web.views.primary import Primaryview
 
  class BlogPrimaryView(PrimaryView):
-     id = 'primary'
+     __regid__ = 'primary'
      __select__ = PrimaryView.__select__ & implements('Blog')
      rql = 'Any BE ORDERBY D DESC WHERE BE entry_of B, BE publish_date D, B eid %(b)s'
 
@@ -162,7 +162,7 @@
              self.w(u'<p>%s</p>' % entry.view('inblogcontext'))
 
  class BlogEntryInBlogView(EntityView):
-     id = 'inblogcontext'
+     __regid__ = 'inblogcontext'
      __select__ = implements('BlogEntry')
 
      def cell_call(self, row, col):
--- a/doc/book/en/development/webstdlib/basetemplates.rst	Tue Mar 02 19:11:46 2010 +0100
+++ b/doc/book/en/development/webstdlib/basetemplates.rst	Tue Mar 02 19:15:26 2010 +0100
@@ -130,7 +130,7 @@
                                                     view=view, context=context))
         if boxes:
             for box in boxes:
-                if box.id == 'search_box':
+                if box.__regid__ == 'search_box':
                     box.dispatch(w=self.w, view=view)
 
 
@@ -159,7 +159,7 @@
 .. _TheMainTemplate:
 
 TheMainTemplate is responsible for the general layout of the entire application.
-It defines the template of ``id = main`` that is used by the instance.
+It defines the template of ``__regid__ = main`` that is used by the instance.
 
 The default main template (`cubicweb.web.views.basetemplates.TheMainTemplate`)
 builds the page based on the following pattern:
--- a/doc/book/en/development/webstdlib/primary.rst	Tue Mar 02 19:11:46 2010 +0100
+++ b/doc/book/en/development/webstdlib/primary.rst	Tue Mar 02 19:15:26 2010 +0100
@@ -27,7 +27,7 @@
 
     class PrimaryView(EntityView):
         """the full view of an non final entity"""
-        id = 'primary'
+        __regid__ = 'primary'
         title = _('primary')
         show_attr_label = True
         show_rel_label = True
--- a/doc/book/en/intro/tutorial/maintemplate.rst	Tue Mar 02 19:11:46 2010 +0100
+++ b/doc/book/en/intro/tutorial/maintemplate.rst	Tue Mar 02 19:15:26 2010 +0100
@@ -116,7 +116,7 @@
 our application.
 
 TheMainTemplate is responsible for the general layout of the entire application.
-It defines the template of ``id = main`` that is used by the application. Is
+It defines the template of ``__regid__ = main`` that is used by the application. Is
 also defined in ``cubicweb/web/views/basetemplates.py`` another template that can
 be used based on TheMainTemplate called SimpleMainTemplate which does not have
 a top section.