Fixed #12806 -- Added an implementation of RawQuerySet.__getitem__. Thanks, Bruno Renié.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12504 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2010-02-23 05:22:12 +00:00
parent 349827996b
commit c4699b0b8a
5 changed files with 35 additions and 2 deletions

View file

@ -1334,6 +1334,9 @@ class RawQuerySet(object):
def __repr__(self):
return "<RawQuerySet: %r>" % (self.raw_query % self.params)
def __getitem__(self, k):
return list(self)[k]
@property
def db(self):
"Return the database that will be used if this query is executed now"