Fixed #5115 -- Fixed QuerySet slices to allow longs.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5831 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Gary Wilson Jr 2007-08-08 21:09:55 +00:00
parent 9170744304
commit 049212e950
2 changed files with 14 additions and 1 deletions

View file

@ -114,7 +114,7 @@ class _QuerySet(object):
def __getitem__(self, k):
"Retrieve an item or slice from the set of results."
if not isinstance(k, (slice, int)):
if not isinstance(k, (slice, int, long)):
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)), \