diff --git a/checkin_notes b/checkin_notes index 6f49e96a31..df7bbf50ee 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4901,3 +4901,10 @@ Charlie 1 June 2009 clientgui/ AsyncRPC.cpp browser.cpp + +David 1 June 2009 + - python DB code: add clear cache method, and fix equality crash + (from Jeremy Cowles) + + py/Boinc/ + boinc_db.py diff --git a/py/Boinc/db_base.py b/py/Boinc/db_base.py index 6e6f11fe3b..a42bddb85e 100644 --- a/py/Boinc/db_base.py +++ b/py/Boinc/db_base.py @@ -246,6 +246,12 @@ class DatabaseTable: and not just "id")''' pass + def clear_cache(self): + """ + Clears the cached objects list + """ + self.object_cache = [] + def count(self, **kwargs): """Return the number of database objects matching keywords. @@ -450,7 +456,7 @@ class DatabaseObject: self.do_init(kwargs) def __eq__(self, other): - return other!=None and self.id == other.id + return other!=None and isinstance(other, DatabaseObject) and self.id == other.id def __ne__(self, other): return not (self == other) def __hash__(self):