title: Is there a clever way to get the previous/next item using the Django ORM?
body: <p>Say I have a list of photos ordered by creation date, as follows:</p>
  
  <pre><code>class Photo(models.Model):
      title = models.Char()
      image = models.Image()
      created = models.DateTimeField(auto_now_add=True)
  
      class Meta:
          ordering = ('-created',)
  </code></pre>
  
  <p>I have an arbitrary Photo object photo_x. Is there an easy way to find the previous and next photos by position in the queryset? Also, I would like to wrap around if I am at the beginning/end and have it not fail if the are only 1 or 2 photos.</p>