cubicweb/entity.py
changeset 11729 809407cbff11
parent 11348 70337ad23145
child 11759 7b7108eb8178
equal deleted inserted replaced
11728:b96bed36765d 11729:809407cbff11
   150 class Entity(AppObject):
   150 class Entity(AppObject):
   151     """an entity instance has e_schema automagically set on
   151     """an entity instance has e_schema automagically set on
   152     the class and instances has access to their issuing cursor.
   152     the class and instances has access to their issuing cursor.
   153 
   153 
   154     A property is set for each attribute and relation on each entity's type
   154     A property is set for each attribute and relation on each entity's type
   155     class. Becare that among attributes, 'eid' is *NEITHER* stored in the
   155     class. Becare that among attributes, 'eid' is *NEVER* stored in the
   156     dict containment (which acts as a cache for other attributes dynamically
   156     dict containment (which acts as a cache for other attributes dynamically
   157     fetched)
   157     fetched)
   158 
   158 
   159     :type e_schema: `cubicweb.schema.EntitySchema`
   159     :type e_schema: `cubicweb.schema.EntitySchema`
   160     :ivar e_schema: the entity's schema
   160     :ivar e_schema: the entity's schema
   772         execute = self._cw.execute
   772         execute = self._cw.execute
   773         skip_copy_for = {'subject': set(), 'object': set()}
   773         skip_copy_for = {'subject': set(), 'object': set()}
   774         for rtype in self.skip_copy_for:
   774         for rtype in self.skip_copy_for:
   775             skip_copy_for['subject'].add(rtype)
   775             skip_copy_for['subject'].add(rtype)
   776             warn('[3.14] skip_copy_for on entity classes (%s) is deprecated, '
   776             warn('[3.14] skip_copy_for on entity classes (%s) is deprecated, '
   777                  'use cw_skip_for instead with list of couples (rtype, role)' % self.cw_etype,
   777                  'use cw_skip_copy_for instead with list of couples (rtype, role)' % self.cw_etype,
   778                  DeprecationWarning)
   778                  DeprecationWarning)
   779         for rtype, role in self.cw_skip_copy_for:
   779         for rtype, role in self.cw_skip_copy_for:
   780             assert role in ('subject', 'object'), role
   780             assert role in ('subject', 'object'), role
   781             skip_copy_for[role].add(rtype)
   781             skip_copy_for[role].add(rtype)
   782         for rschema in self.e_schema.subject_relations():
   782         for rschema in self.e_schema.subject_relations():