Thanks Daniel!

I didn't realize that "FOO_gt=..." would go to the next.  I guess I
was thinking that'd only work with dates, ints, things that have to do
with numbers.  (I'm new to this stuff).

Provided what you gave me, I came up with the follow:

        def get_prev_by_title(self):
                get_prev = Product.objects.order_by('-
title').filter(title__lt=self.title)
                try:
                        return get_prev[0]
                except IndexError:
                        return None


        def get_next_by_title(self):
                get_next =
Product.objects.order_by('title').filter(title__gt=self.title)
                try:
                        return get_next[0]
                except IndexError:
                        return None

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to