Skip to content
Browse files

Fixed #2351 -- Fixed problem with using ".count" attribute of QuerySe…

…ts in


git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 29aa31d commit 858ac0580228a4ee8ae8a8cbeb1887ae824d2ef1 @malcolmt malcolmt committed
Showing with 2 additions and 0 deletions.
  1. +2 −0 django/db/models/
2 django/db/models/
@@ -109,6 +109,8 @@ def __iter__(self):
def __getitem__(self, k):
"Retrieve an item or slice from the set of results."
+ if not isinstance(k, (slice, int)):
+ raise TypeError
assert (not isinstance(k, slice) and (k >= 0)) \
or (isinstance(k, slice) and (k.start is None or k.start >= 0) and (k.stop is None or k.stop >= 0)), \
"Negative indexing is not supported."

0 comments on commit 858ac05

Please sign in to comment.
Something went wrong with that request. Please try again.