> current_show = 5 #Presumably you get this in your request
> show_range = (current_show - 4, current_show + 4)
> shows = Show.objects.filter(show_order__range=show_range)

This seems to work so far.

shows = Show.objects.filter(Q(pk__range=(show_id - 4, show_id + 4) & Q
(category=category))

Behind the scenes it preforms a BETWEEN query.

Thanks to all for the help!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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