I ran into this problem also. I believe the fix is to make the following
two changes:
In SQLObject.py, change this line in the destroy method of SQLObject:
self._connection.cache.purge(self,self.id)
To:
self._connection.cache.purge(self.__class__,self.id)
In the Cache.py file, add this method to the CacheSet class:
def purge(self, cls, id):
try:
self.caches[cls.__name__].purge(id)
except KeyError:
pass
Perhaps Ian might verify that this is the correct fix.
This is not related to the bug you ran into, but I also found I had to
add this function to Constraints.py:
def isFloat(obj, col, value):
if type(value) is not (type(1.1)):
raise BadValue("only allows floats", obj, col, value)
Regards,
Bob
-----Original Message-----
From: Mohanaraj [mailto:sar...@am...]=20
Sent: Wednesday, May 21, 2003 5:26 PM
To: sql...@li...
Subject: [SQLObject] destroy() throwing an exception : AttributeError:
'CacheSet' object has no attribute 'purge'
Dear all,
I am using python2.2, sqlobject0.3 and sqlite. When I try to destroy an
object=20
I get the following exception. I have tried commenting line 831 in the
code=20
and it seems to work after that. I have not tried this with any other db
other then sqlite. Any feedback would be graciously appreciated.
Thanks mates.
>>> food =3D Food.new(name=3D'Dodo')
>>> food.destroy()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/site-packages/SQLObject/SQLObject.py", line
831, in=20
destroy
self._connection.cache.purge(self.id)
AttributeError: 'CacheSet' object has no attribute 'purge'
>>>
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore. Now
part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
sqlobject-discuss mailing list sql...@li...
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
|