add where() method to QuerySet

This commit is contained in:
Dan Crosta
2011-07-20 12:41:20 -04:00
parent 72aa191e70
commit 13afead9fb
2 changed files with 33 additions and 0 deletions

View File

@@ -1397,6 +1397,11 @@ class QuerySet(object):
db = _get_db()
return db.eval(code, *fields)
def where(self, where_clause):
where_clause = self._sub_js_fields(where_clause)
self._where_clause = where_clause
return self
def sum(self, field):
"""Sum over the values of the specified field.