currently its not removing deleted items from lists. if you had an object "A" that was installed within the lists of 20 other objects, would I maintain a backwards lookup table of all the lists that object is present in to find them when its marked as deleted ? i fear that may an excessive use of resources. feel free to add an enhancement ticket, maybe this could be an enableable option.

On Feb 21, 2006, at 2:46 PM, dmiller wrote:

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



-------------------------------------------------------
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

Reply via email to