From 8cd32bddab2cd902fe2522de344839aaa55f2b23 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 1 Jun 2006 15:01:22 +0000 Subject: [PATCH] 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 --- django/db/models/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/models/base.py b/django/db/models/base.py index 75969f53b1..3538826356 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -279,7 +279,7 @@ class Model(object): 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()