Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug in Model._get_next_or_previous_in_order()

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8cd32bddab2cd902fe2522de344839aaa55f2b23 1 parent 56131d0
@adrianholovaty adrianholovaty authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/db/models/base.py
View
2  django/db/models/base.py
@@ -279,7 +279,7 @@ def _get_next_or_previous_in_order(self, is_next):
order_field = self._meta.order_with_respect_to
where = ['%s %s (SELECT %s FROM %s WHERE %s=%%s)' % \
(backend.quote_name('_order'), op, backend.quote_name('_order'),
- backend.quote_name(opts.db_table), backend.quote_name(opts.pk.column)),
+ backend.quote_name(self._meta.db_table), backend.quote_name(self._meta.pk.column)),
'%s=%%s' % backend.quote_name(order_field.column)]
params = [self._get_pk_val(), getattr(self, order_field.attname)]
obj = self._default_manager.order_by('_order').extra(where=where, params=params)[:1].get()
Please sign in to comment.
Something went wrong with that request. Please try again.