cubicweb/entity.py
changeset 12508 a8c1ea390400
parent 11891 67185e65f020
child 12542 85194bd49119
--- a/cubicweb/entity.py	Thu Mar 14 14:45:35 2019 +0100
+++ b/cubicweb/entity.py	Thu Mar 14 12:08:37 2019 +0100
@@ -23,7 +23,6 @@
 from six.moves import range
 
 from logilab.common.decorators import cached
-from logilab.common.deprecation import deprecated
 from logilab.common.registry import yes
 from logilab.mtconverter import TransformData, xml_escape
 
@@ -175,7 +174,6 @@
     # class attributes that must be set in class definition
     rest_attr = None
     fetch_attrs = None
-    skip_copy_for = () # bw compat (< 3.14), use cw_skip_copy_for instead
     cw_skip_copy_for = [('in_state', 'subject')]
     # class attributes set automatically at registration time
     e_schema = None
@@ -256,23 +254,11 @@
             select.add_sort_var(var, asc=False)
 
     @classmethod
-    def fetch_rql(cls, user, restriction=None, fetchattrs=None, mainvar='X',
+    def fetch_rql(cls, user, fetchattrs=None, mainvar='X',
                   settype=True, ordermethod='fetch_order'):
         st = cls.fetch_rqlst(user, mainvar=mainvar, fetchattrs=fetchattrs,
                              settype=settype, ordermethod=ordermethod)
-        rql = st.as_string()
-        if restriction:
-            # cannot use RQLRewriter API to insert 'X rtype %(x)s' restriction
-            warn('[3.14] fetch_rql: use of `restriction` parameter is '
-                 'deprecated, please use fetch_rqlst and supply a syntax'
-                 'tree with your restriction instead', DeprecationWarning)
-            insert = ' WHERE ' + ','.join(restriction)
-            if ' WHERE ' in rql:
-                select, where = rql.split(' WHERE ', 1)
-                rql = select + insert + ',' + where
-            else:
-                rql += insert
-        return rql
+        return st.as_string()
 
     @classmethod
     def fetch_rqlst(cls, user, select=None, mainvar='X', fetchattrs=None,
@@ -622,14 +608,6 @@
         """
         return self.has_eid() and self._cw_is_saved
 
-    @deprecated('[3.24] cw_metainformation is deprecated')
-    @cached
-    def cw_metainformation(self):
-        source = self.cw_source[0].name
-        return {'type': self.cw_etype,
-                'extid': self.cwuri if source != 'system' else None,
-                'source': {'uri': source}}
-
     def cw_check_perm(self, action):
         self.e_schema.check_perm(self._cw, action, eid=self.eid)
 
@@ -759,11 +737,6 @@
         assert self.has_eid()
         execute = self._cw.execute
         skip_copy_for = {'subject': set(), 'object': set()}
-        for rtype in self.skip_copy_for:
-            skip_copy_for['subject'].add(rtype)
-            warn('[3.14] skip_copy_for on entity classes (%s) is deprecated, '
-                 'use cw_skip_copy_for instead with list of couples (rtype, role)' % self.cw_etype,
-                 DeprecationWarning)
         for rtype, role in self.cw_skip_copy_for:
             assert role in ('subject', 'object'), role
             skip_copy_for[role].add(rtype)
@@ -1343,29 +1316,6 @@
         for rqlexpr in self.e_schema.get_rqlexprs(action):
             self._cw.local_perm_cache.pop((rqlexpr.eid, (('x', self.eid),)), None)
 
-    # deprecated stuff #########################################################
-
-    @deprecated('[3.16] use cw_set() instead of set_attributes()')
-    def set_attributes(self, **kwargs): # XXX cw_set_attributes
-        if kwargs:
-            self.cw_set(**kwargs)
-
-    @deprecated('[3.16] use cw_set() instead of set_relations()')
-    def set_relations(self, **kwargs): # XXX cw_set_relations
-        """add relations to the given object. To set a relation where this entity
-        is the object of the relation, use 'reverse_'<relation> as argument name.
-
-        Values may be an entity or eid, a list of entities or eids, or None
-        (meaning that all relations of the given type from or to this object
-        should be deleted).
-        """
-        if kwargs:
-            self.cw_set(**kwargs)
-
-    @deprecated('[3.13] use entity.cw_clear_all_caches()')
-    def clear_all_caches(self):
-        return self.cw_clear_all_caches()
-
 
 # attribute and relation descriptors ##########################################
 
@@ -1381,13 +1331,6 @@
             return self
         return eobj.cw_attr_value(self._attrname)
 
-    @deprecated('[3.10] assign to entity.cw_attr_cache[attr] or entity.cw_edited[attr]')
-    def __set__(self, eobj, value):
-        if hasattr(eobj, 'cw_edited') and not eobj.cw_edited.saved:
-            eobj.cw_edited[self._attrname] = value
-        else:
-            eobj.cw_attr_cache[self._attrname] = value
-
 
 class Relation(object):
     """descriptor that controls schema relation access"""