def __setslice__(self, i, j, seq):
     old = list.__getslice__(self, i, j)
     for f in old:
         self.__unregister_field(f)
     for f in seq:
         self.__register_field(f)
     list.__setslice__(self, i, j, seq)
 def __setslice__(self, i, j, seq):
     old=list.__getslice__(self, i, j)
     for f in old:
         self.__unregister_field(f)
     for f in seq:
         self.__register_field(f)
     list.__setslice__(self, i, j, seq)
    def __setslice__ (self, i, j, collection):
        """L.__setslice__ (i, j, collection) -> L[i:j] = collection

        Raises a TypeError, if the passed collection argument does not
        inherit from the ListItemCollection class.
        """
        if not isinstance (collection, ListItemCollection):
            raise TypeError ("collection must inherit from ListItemCollection")

        old = UserList.__getslice__ (self, i, j)
        UserList.__setslice__ (self, i, j, collection[:])
        new = UserList.__getslice__ (self, i, j)
        
        # Clean up the old ones.
        for item in old:
            item.collection = None
            self._length -= 1
            del item

        # Set the relations for the new ones.
        for item in new:
            item.collection = self
            self._length += 1
        if self.list_changed:
            self.list_changed (self)
Example #4
0
    def __setslice__(self, i, j, collection):
        """L.__setslice__ (i, j, collection) -> L[i:j] = collection

        Raises a TypeError, if the passed collection argument does not
        inherit from the ListItemCollection class.
        """
        if not isinstance(collection, ListItemCollection):
            raise TypeError("collection must inherit from ListItemCollection")

        old = UserList.__getslice__(self, i, j)
        UserList.__setslice__(self, i, j, collection[:])
        new = UserList.__getslice__(self, i, j)

        # Clean up the old ones.
        for item in old:
            item.collection = None
            self._length -= 1
            del item

        # Set the relations for the new ones.
        for item in new:
            item.collection = self
            self._length += 1
        if self.list_changed:
            self.list_changed(self)
Example #5
0
 def __setslice__(self, i, j, other):
     for obj in other:
         validateInformation(obj)
     UserList.__setslice__(self, i, j, other)
Example #6
0
 def __setslice__(self, i, j, other):
     for obj in other:
         validateInformation(obj)
     UserList.__setslice__(self, i, j, other)
Example #7
0
 def __setslice__(self, i, j, other):
     UserList.__setslice__(self, i, j, other)
     self.notify()
Example #8
0
 def __setslice__(self, i, j, other):
     UserList.__setslice__(self, i, j, other)
     self.unique = False
Example #9
0
 def __setslice__(self, i, j, other):
     UserList.__setslice__(self, i, j, other)
     self._changed()
Example #10
0
 def __setslice__(self, i, j, other):
     UserList.__setslice__(self, i, j, other)
     self.unique = False
Example #11
0
	def __setslice__(self, i, j, other):
		UserList.__setslice__(self, i, j, other)
		self._changed()
Example #12
0
 def __setslice__(self, i, j, s):
     return UserList.__setslice__(self, i, j, s)
Example #13
0
 def __setslice__(self, i, j, s):
    return UserList.__setslice__(self, i, j, s)