 <p>To get the next object, first filter to get all objects with a higher priority:</p> <pre><code>objects = MyObjects.objects.filter(priority__gt=12) </code></pre> <p>then order the results by priority:</p> <pre><code>objects = objects.order_by('priority') </code></pre> <p>finally select the first item in the queryset:</p> <pre><code>next_obj = objects.first() </code></pre> <p>Putting it together:</p> <pre><code>next_obj = MyObjects.objects.filter(priority__gt=12).order_by('priority').first() </code></pre> <p>Getting the previous object is similar, but you need to order in reverse:</p> <pre><code>prev_obj = MyObjects.objects.filter(priority__lt=12).order_by('-priority').first() </code></pre> <p>Note that <a href="https://docs.djangoproject.com/en/1.7/ref/models/querysets/#django.db.models.query.QuerySet.first" rel="nofollow"><code>first()</code></a> can return <code>None</code> if there are no objects in the queryset (in your case, that means the current object has the highest or lowest priority in the list). If the same priority can appear more than once, you might want to adjust the code to use <a href="https://docs.djangoproject.com/en/1.7/ref/models/querysets/#gte" rel="nofollow"><code>gte</code></a> and <a href="https://docs.djangoproject.com/en/1.7/ref/models/querysets/#lte" rel="nofollow"><code>lte</code></a>.</p>