> > Assuming (start1, end1) is the range you want to validate against > SomeModel's time.end and time.start fields: > > SomeModel.objects.filter(time__end__gte=start1, > time__start__lte=end1).count() > > Basically, this is an implemenation of your above math rewritten this > way: > > ( end2 >= start1 and start2 <= end1 ) > > -Rajesh D
Thanks, this works perfectly --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---