--- a/entity.py Fri May 02 17:41:11 2014 +0200
+++ b/entity.py Fri May 02 17:57:37 2014 +0200
@@ -1367,100 +1367,6 @@
def clear_all_caches(self):
return self.cw_clear_all_caches()
- @property
- @deprecated('[3.10] use entity.cw_edited')
- def edited_attributes(self):
- return self.cw_edited
-
- @property
- @deprecated('[3.10] use entity.cw_edited.skip_security')
- def skip_security_attributes(self):
- return self.cw_edited.skip_security
-
- @property
- @deprecated('[3.10] use entity.cw_edited.skip_security')
- def _cw_skip_security_attributes(self):
- return self.cw_edited.skip_security
-
- @property
- @deprecated('[3.10] use entity.cw_edited.querier_pending_relations')
- def querier_pending_relations(self):
- return self.cw_edited.querier_pending_relations
-
- @deprecated('[3.10] use key in entity.cw_attr_cache')
- def __contains__(self, key):
- return key in self.cw_attr_cache
-
- @deprecated('[3.10] iter on entity.cw_attr_cache')
- def __iter__(self):
- return iter(self.cw_attr_cache)
-
- @deprecated('[3.10] use entity.cw_attr_cache[attr]')
- def __getitem__(self, key):
- return self.cw_attr_cache[key]
-
- @deprecated('[3.10] use entity.cw_attr_cache.get(attr[, default])')
- def get(self, key, default=None):
- return self.cw_attr_cache.get(key, default)
-
- @deprecated('[3.10] use entity.cw_attr_cache.clear()')
- def clear(self):
- self.cw_attr_cache.clear()
- # XXX clear cw_edited ?
-
- @deprecated('[3.10] use entity.cw_edited[attr] = value or entity.cw_attr_cache[attr] = value')
- def __setitem__(self, attr, value):
- """override __setitem__ to update self.cw_edited.
-
- Typically, a before_[update|add]_hook could do::
-
- entity['generated_attr'] = generated_value
-
- and this way, cw_edited will be updated accordingly. Also, add
- the attribute to skip_security since we don't want to check security
- for such attributes set by hooks.
- """
- try:
- self.cw_edited[attr] = value
- except AttributeError:
- self.cw_attr_cache[attr] = value
-
- @deprecated('[3.10] use del entity.cw_edited[attr]')
- def __delitem__(self, attr):
- """override __delitem__ to update self.cw_edited on cleanup of
- undesired changes introduced in the entity's dict. For example, see the
- code snippet below from the `forge` cube:
-
- .. sourcecode:: python
-
- edited = self.entity.cw_edited
- has_load_left = 'load_left' in edited
- if 'load' in edited and self.entity.load_left is None:
- self.entity.load_left = self.entity['load']
- elif not has_load_left and edited:
- # cleanup, this may cause undesired changes
- del self.entity['load_left']
- """
- del self.cw_edited[attr]
-
- @deprecated('[3.10] use entity.cw_edited.setdefault(attr, default)')
- def setdefault(self, attr, default):
- """override setdefault to update self.cw_edited"""
- return self.cw_edited.setdefault(attr, default)
-
- @deprecated('[3.10] use entity.cw_edited.pop(attr[, default])')
- def pop(self, attr, *args):
- """override pop to update self.cw_edited on cleanup of
- undesired changes introduced in the entity's dict. See `__delitem__`
- """
- return self.cw_edited.pop(attr, *args)
-
- @deprecated('[3.10] use entity.cw_edited.update(values)')
- def update(self, values):
- """override update to update self.cw_edited. See `__setitem__`
- """
- self.cw_edited.update(values)
-
# attribute and relation descriptors ##########################################