magic-removal: Fixed legacy get_object() call in Model._get_next_or_previous_by_FIELD()
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e4112922f7
commit
7ff623755a
|
@ -274,7 +274,7 @@ class Model(object):
|
||||||
kwargs.setdefault('params', []).extend([param, param, getattr(self, self._meta.pk.attname)])
|
kwargs.setdefault('params', []).extend([param, param, getattr(self, self._meta.pk.attname)])
|
||||||
kwargs['order_by'] = [(not is_next and '-' or '') + field.name, (not is_next and '-' or '') + self._meta.pk.name]
|
kwargs['order_by'] = [(not is_next and '-' or '') + field.name, (not is_next and '-' or '') + self._meta.pk.name]
|
||||||
kwargs['limit'] = 1
|
kwargs['limit'] = 1
|
||||||
return self.__class__._default_manager.get_object(**kwargs)
|
return self.__class__._default_manager.get(**kwargs)
|
||||||
|
|
||||||
def _get_next_or_previous_in_order(self, is_next):
|
def _get_next_or_previous_in_order(self, is_next):
|
||||||
cachename = "__%s_order_cache" % is_next
|
cachename = "__%s_order_cache" % is_next
|
||||||
|
|
Loading…
Reference in New Issue