mirror of https://github.com/BOINC/boinc.git
- python DB code: add clear cache method, and fix equality crash
(from Jeremy Cowles) svn path=/trunk/boinc/; revision=18258
This commit is contained in:
parent
f47ae35b4d
commit
cb0c57c590
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue