entity.py
changeset 5559 6b183d860295
parent 5557 1a534c596bff
child 5573 8dfb1726526b
equal deleted inserted replaced
5558:afd1face1faf 5559:6b183d860295
   343             # don't add attribute into skip_security if already in edited
   343             # don't add attribute into skip_security if already in edited
   344             # attributes, else we may accidentaly skip a desired security check
   344             # attributes, else we may accidentaly skip a desired security check
   345             if hasattr(self, 'edited_attributes') and \
   345             if hasattr(self, 'edited_attributes') and \
   346                    attr not in self.edited_attributes:
   346                    attr not in self.edited_attributes:
   347                 self.edited_attributes.add(attr)
   347                 self.edited_attributes.add(attr)
   348                 self.skip_security_attributes.add(attr)
   348                 self._cw_skip_security_attributes.add(attr)
   349 
   349 
   350     def __delitem__(self, attr):
   350     def __delitem__(self, attr):
   351         """override __delitem__ to update self.edited_attributes on cleanup of
   351         """override __delitem__ to update self.edited_attributes on cleanup of
   352         undesired changes introduced in the entity's dict. For example, see the
   352         undesired changes introduced in the entity's dict. For example, see the
   353         code snippet below from the `forge` cube:
   353         code snippet below from the `forge` cube:
   373         # don't add attribute into skip_security if already in edited
   373         # don't add attribute into skip_security if already in edited
   374         # attributes, else we may accidentaly skip a desired security check
   374         # attributes, else we may accidentaly skip a desired security check
   375         if hasattr(self, 'edited_attributes') and \
   375         if hasattr(self, 'edited_attributes') and \
   376                attr not in self.edited_attributes:
   376                attr not in self.edited_attributes:
   377             self.edited_attributes.add(attr)
   377             self.edited_attributes.add(attr)
   378             self.skip_security_attributes.add(attr)
   378             self._cw_skip_security_attributes.add(attr)
   379 
   379 
   380     def pop(self, attr, default=_marker):
   380     def pop(self, attr, default=_marker):
   381         """override pop to update self.edited_attributes on cleanup of
   381         """override pop to update self.edited_attributes on cleanup of
   382         undesired changes introduced in the entity's dict. See `__delitem__`
   382         undesired changes introduced in the entity's dict. See `__delitem__`
   383         """
   383         """