--- a/cubicweb/entities/__init__.py Thu Mar 14 14:45:18 2019 +0100
+++ b/cubicweb/entities/__init__.py Thu Mar 14 14:45:27 2019 +0100
@@ -17,14 +17,9 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""base application's entities class implementation: `AnyEntity`"""
-
-
-from warnings import warn
-
from six import text_type, string_types
from logilab.common.decorators import classproperty
-from logilab.common.deprecation import deprecated
from cubicweb import Unauthorized
from cubicweb.entity import Entity
@@ -47,36 +42,11 @@
return req.build_url('add/%s' % cls.__regid__, **kwargs)
@classmethod
- @deprecated('[3.22] use cw_fti_index_rql_limit instead')
- def cw_fti_index_rql_queries(cls, req):
- """return the list of rql queries to fetch entities to FT-index
-
- The default is to fetch all entities at once and to prefetch
- indexable attributes but one could imagine iterating over
- "smaller" resultsets if the table is very big or returning
- a subset of entities that match some business-logic condition.
- """
- restrictions = ['X is %s' % cls.__regid__]
- selected = ['X']
- for attrschema in sorted(cls.e_schema.indexable_attributes()):
- varname = attrschema.type.upper()
- restrictions.append('X %s %s' % (attrschema, varname))
- selected.append(varname)
- return ['Any %s WHERE %s' % (', '.join(selected),
- ', '.join(restrictions))]
-
- @classmethod
def cw_fti_index_rql_limit(cls, req, limit=1000):
"""generate rsets of entities to FT-index
By default, each successive result set is limited to 1000 entities
"""
- if cls.cw_fti_index_rql_queries.__func__ != AnyEntity.cw_fti_index_rql_queries.__func__:
- warn("[3.22] cw_fti_index_rql_queries is replaced by cw_fti_index_rql_limit",
- DeprecationWarning)
- for rql in cls.cw_fti_index_rql_queries(req):
- yield req.execute(rql)
- return
restrictions = ['X is %s' % cls.__regid__]
selected = ['X']
start = 0