server/edition.py
changeset 7471 bf9443f8725f
parent 7132 e9c92bb79787
child 8493 25da1e5c7c50
--- a/server/edition.py	Tue Jun 07 12:54:45 2011 +0200
+++ b/server/edition.py	Tue Jun 07 16:07:06 2011 +0200
@@ -68,6 +68,11 @@
         super(EditedEntity, self).__delitem__(attr)
         self.entity.cw_attr_cache.pop(attr, None)
 
+    def __copy__(self):
+        # default copy protocol fails in EditedEntity.__setitem__ because
+        # copied entity has no skip_security attribute at this point
+        return EditedEntity(self.entity, **self)
+
     def pop(self, attr, *args):
         # don't update skip_security by design (think to storage api)
         assert not self.saved, 'too late to modify edited attributes'