[doc, adapters] drop deprecated code from examples stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 26 Aug 2010 10:52:59 +0200
branchstable
changeset 6157 81ae5bc958db
parent 6156 2f0dd9494b33
child 6158 1f2682f2eaba
[doc, adapters] drop deprecated code from examples
doc/book/en/devrepo/entityclasses/adapters.rst
doc/book/en/tutorials/base/create-cube.rst
--- a/doc/book/en/devrepo/entityclasses/adapters.rst	Thu Aug 26 10:52:25 2010 +0200
+++ b/doc/book/en/devrepo/entityclasses/adapters.rst	Thu Aug 26 10:52:59 2010 +0200
@@ -42,6 +42,16 @@
 The adapter object has ``self.entity`` attribute which represents the
 entity being adapted.
 
+.. Note::
+
+   Adapters came with the notion of service identified by the registry identifier
+   of an adapters, hence dropping the need for explicit interface and the
+   :class:`cubicweb.selectors.implements` selector. You should instead use
+   :class:`cubicweb.selectors.is_instance` when you want to select on an entity
+   type, or :class:`cubicweb.selectors.adaptable` when you want to select on a
+   service.
+
+
 Specializing and binding an adapter
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -61,12 +71,6 @@
 ``MyEntity`` entity type (the `adaptee`).
 
 
-Selecting on an adapter
-~~~~~~~~~~~~~~~~~~~~~~~
-
-There is an ``adaptable`` selector which can be used instead of
-``implements``.
-
 .. _interfaces_to_adapters:
 
 Converting code from Interfaces/Mixins to Adapters
@@ -94,11 +98,11 @@
 
 .. sourcecode:: python
 
-    from cubicweb.selectors import adaptable, implements
+    from cubicweb.selectors import adaptable, is_instance
     from cubicweb.entities.adapters import ITreeAdapter
 
     class MyEntityITreeAdapter(ITreeAdapter):
-        __select__ = implements('MyEntity')
+        __select__ = is_instance('MyEntity')
 
     class ITreeView(EntityView):
         __select__ = adaptable('ITree')
--- a/doc/book/en/tutorials/base/create-cube.rst	Thu Aug 26 10:52:25 2010 +0200
+++ b/doc/book/en/tutorials/base/create-cube.rst	Thu Aug 26 10:52:59 2010 +0200
@@ -357,7 +357,6 @@
     class BlogEntry(AnyEntity):
         """customized class for BlogEntry entities"""
     	__regid__ = 'BlogEntry'
-    	__implements__ = AnyEntity.__implements__
 
         def display_cw_logo(self):
             if 'CW' in self.title: