Example:
>>> en = Entity(...) # SQLAlchemy entity class
>>> len(en.attrs)
2
>>> a = en.attrs[0]
>>> objectstore.delete(a)
>>> len(en.attrs) # should this return 1?
2
>>> objectstore.commit()
>>> len(en.attrs) # this should definitely return 1
2
It appears that AttributeManager is not removing deleted items from
lists.
objectstore.py (UnitOfWork)
def _remove_deleted(self, obj):
if hasattr(obj, "_instance_key"):
del self.identity_map[obj._instance_key]
try:
del self.deleted[obj]
except KeyError:
pass
try:
del self.dirty[obj]
except KeyError:
pass
try:
del self.new[obj]
except KeyError:
pass
self.attributes.commit(obj)
self.attributes.remove(obj) <<-- THIS IS WHERE IT SHOULD HAPPEN
attributes.py (AttributeManager)
def remove(self, obj):
"""not sure what this is."""
pass
But it doesn't do anything... Does this mean I have to throw away all
my objects that have modified collections and reload them after every
commit? I'd prefer not.
~ Daniel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users