# HG changeset patch # User Sylvain Thénault # Date 1308045281 -7200 # Node ID dc823b9ce74ba8d088a9d44dc441c3c88ef650af # Parent 09d245a9bf5ff68c4dd8e702e7a0037028e9b3ff [data hook] new .union operation on DataOperationMixIn, only when container is a set, not a list diff -r 09d245a9bf5f -r dc823b9ce74b server/hook.py --- a/server/hook.py Fri Jun 10 17:21:17 2011 +0200 +++ b/server/hook.py Tue Jun 14 11:54:41 2011 +0200 @@ -852,6 +852,13 @@ def _build_container(self): return self.containercls() + def union(self, data): + """only when container is a set""" + assert not self._processed, """Trying to add data to a closed operation. +Iterating over operation data closed it and should be reserved to precommit / +postcommit method of the operation.""" + self._container |= data + def add_data(self, data): assert not self._processed, """Trying to add data to a closed operation. Iterating over operation data closed it and should be reserved to precommit /