def listing_in_cache(self, listing): lquery = Query() return self.db.contains(lquery.hsh == listing.hsh)