fix broken query, at least w/ django 1.6