mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Fixed bug with Meta.ordering being ignored when slicing a single item off a QuerySet. Thanks, Gábor Fawkes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2970 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -269,8 +269,8 @@ class Model(object):
|
||||
q._params.extend([param, param, getattr(self, self._meta.pk.attname)])
|
||||
try:
|
||||
return q[0]
|
||||
except IndexError, e:
|
||||
raise self.DoesNotExist, e.args
|
||||
except IndexError:
|
||||
raise self.DoesNotExist, "%s matching query does not exist." % self.__class__._meta.object_name
|
||||
|
||||
def _get_next_or_previous_in_order(self, is_next):
|
||||
cachename = "__%s_order_cache" % is_next
|
||||
|
||||
Reference in New Issue
Block a user