fix broken query, at least w/ django 1.6
Merge branch 'master' into dev