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)
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)
def __setslice__(self, i, j, other): for obj in other: validateInformation(obj) UserList.__setslice__(self, i, j, other)
def __setslice__(self, i, j, other): UserList.__setslice__(self, i, j, other) self.notify()
def __setslice__(self, i, j, other): UserList.__setslice__(self, i, j, other) self.unique = False
def __setslice__(self, i, j, other): UserList.__setslice__(self, i, j, other) self._changed()
def __setslice__(self, i, j, s): return UserList.__setslice__(self, i, j, s)