Did you want to group orders based on the twelve five minute intervals in an hour? By five minute intervals, I mean a minutes to interval mapping like this: (0..4 => 0, 5..9 => 1, 10..14 => 2, ...).
all_with_interval = SomeModel.objects.extra(
select={'interval': "strftime('%%M', date)/5"})
just_minutes_5_to_9 = all_with_interval.extra(
where=["interval=%d"], params=[0])
Or maybe you want a five minute range from an given start_time:
end_time = start_time + datetime.timedelta(minutes=5)
start_plus_5_inclusive = SomeModel.filter(date__range=(start_time, end_time)
start_plus_5_exclusive = start_plus_5_inclusive.exclude(end_time)
The exclude() is there because the range filter is inclusive and you probably want to exclude the end_time for this current question. If you do not exclude end_time you could get records in a 5 minute + ~1 second time range.