Mercurial > pylearn
diff pylearn/dbdict/api0.py @ 619:fa6585609e01
added api0.filter_eq_dct
author | James Bergstra <bergstrj@iro.umontreal.ca> |
---|---|
date | Sat, 17 Jan 2009 21:20:32 -0500 |
parents | a88ead1a1537 |
children | 7041749cf804 |
line wrap: on
line diff
--- a/pylearn/dbdict/api0.py Sat Jan 17 19:13:17 2009 -0500 +++ b/pylearn/dbdict/api0.py Sat Jan 17 21:20:32 2009 -0500 @@ -307,6 +307,12 @@ return h_self._Query(q) + def filter_eq_dct(q_self, dct): + rval = q_self + for key, val in dct.items(): + rval = rval.filter_eq(key,val) + return rval + def all(q_self): """Return an iterator over all matching dictionaries.