From 25aef18d8358e7a89e99caf0c6b91f7179b6572b Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 29 Aug 2005 15:35:04 +0000 Subject: [PATCH] Fixed bug in metasystem method_get_next_in_order and method_get_previous_in_order, related to [549] git-svn-id: http://code.djangoproject.com/svn/django/trunk@570 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/meta/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py index 6f72090e84..ea68ca59f9 100644 --- a/django/core/meta/__init__.py +++ b/django/core/meta/__init__.py @@ -849,7 +849,7 @@ def method_get_next_in_order(opts, order_field, self): self._next_in_order_cache = opts.get_model_module().get_object(order_by=('_order',), where=['_order > (SELECT _order FROM %s WHERE %s=%%s)' % (opts.db_table, opts.pk.column), '%s=%%s' % order_field.column], limit=1, - params=[getattr(self, opts.pk.column), getattr(self, order_field.name)]) + params=[getattr(self, opts.pk.column), getattr(self, order_field.column)]) return self._next_in_order_cache def method_get_previous_in_order(opts, order_field, self): @@ -857,7 +857,7 @@ def method_get_previous_in_order(opts, order_field, self): self._previous_in_order_cache = opts.get_model_module().get_object(order_by=('-_order',), where=['_order < (SELECT _order FROM %s WHERE %s=%%s)' % (opts.db_table, opts.pk.column), '%s=%%s' % order_field.column], limit=1, - params=[getattr(self, opts.pk.column), getattr(self, order_field.name)]) + params=[getattr(self, opts.pk.column), getattr(self, order_field.column)]) return self._previous_in_order_cache # RELATIONSHIP METHODS #####################