def filter_by(self, **kwargs): """apply the given filtering criterion to the query and return the newly resulting ``Query``.""" clauses = [_entity_descriptor(self._joinpoint_zero(), key)[0] == value for key, value in kwargs.iteritems()] return self.filter(sql.and_(*clauses))