try to add a real "replace collection" to association proxy
Issue #2642
new
the "clear" here is clumsy and originally thought was the ultimate cause of the original issue in #2637 it's not. Might be nicer if we had a bulk replace built in for those collections, would emit fewer events.
def __set__(self, obj, values):
if self.owning_class is None:
self.owning_class = type(obj)
if self.scalar:
creator = self.creator and self.creator or self.target_class
target = getattr(obj, self.target_collection)
if target is None:
setattr(obj, self.target_collection, creator(values))
else:
self._scalar_set(target, values)
else:
proxy = self.__get__(obj, None)
if proxy is not values:
proxy.clear()
self._set(proxy, values)
Comments (7)
-
reporter -
reporter - marked as enhancement
-
reporter - changed milestone to 0.x.xx
-
reporter - changed milestone to 1.x.xx
-
reporter it's a bug though see
#3583 -
reporter Issue
#3583was marked as a duplicate of this issue. -
reporter - marked as bug
- edited description
- Log in to comment
found the real issue regarding
#2637, it's not the clear(), was a missing backref implementation. The clear() here is still possibly something that can be improved but this is low priority.