# HG changeset patch # User Sylvain Thénault # Date 1282812779 -7200 # Node ID 81ae5bc958db99a2cbf61883960d6ad9c27dcf15 # Parent 2f0dd9494b33e364ddb6c5bb7650e39ffd1d9e90 [doc, adapters] drop deprecated code from examples diff -r 2f0dd9494b33 -r 81ae5bc958db doc/book/en/devrepo/entityclasses/adapters.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') diff -r 2f0dd9494b33 -r 81ae5bc958db doc/book/en/tutorials/base/create-cube.rst --- 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: