Skip to content

Commit

Permalink
Fixed bug in Model._get_next_or_previous_in_order()
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Jun 1, 2006
1 parent 56131d0 commit 8cd32bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/db/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 8cd32bd

Please sign in to comment.