[vreg] object_by_id should not have been deprecated. Fix facets.
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 22 Jan 2010 14:40:14 +0100
changeset 4333 7add8a73a168
parent 4330 cb7b68679501
child 4334 dda74c345b06
[vreg] object_by_id should not have been deprecated. Fix facets. it was *designed* to be able to force an object retreival when selection is potentially not possible. For instance using select instead of object_by_id in get_facet totally breaks the implementation since in get_facet we've not context result set, and we ends up with a NoSelectableObject exception.
vregistry.py
web/facet.py
--- a/vregistry.py	Fri Jan 22 11:40:22 2010 +0100
+++ b/vregistry.py	Fri Jan 22 14:40:14 2010 +0100
@@ -139,7 +139,6 @@
 
     # dynamic selection methods ################################################
 
-    @deprecated('[3.6] use select instead of object_by_id')
     def object_by_id(self, oid, *args, **kwargs):
         """return object with the given oid. Only one object is expected to be
         found.
--- a/web/facet.py	Fri Jan 22 11:40:22 2010 +0100
+++ b/web/facet.py	Fri Jan 22 14:40:14 2010 +0100
@@ -64,8 +64,8 @@
 
 
 def get_facet(req, facetid, rqlst, mainvar):
-    return req.vreg['facets'].select(facetid, req, rqlst=rqlst,
-                                     filtered_variable=mainvar)
+    return req.vreg['facets'].object_by_id(facetid, req, rqlst=rqlst,
+                                           filtered_variable=mainvar)
 
 
 def filter_hiddens(w, **kwargs):