On 14 nov, 20:21, "Jean-Luc" <[EMAIL PROTECTED]> wrote: > James Bennett a écrit : > > > On 11/14/06, James Bennett <[EMAIL PROTECTED]> wrote: > > > IIRC I'm the one who made it do that, and it was because, at the time, > > > the way Django handled the 'range' lookup was *not* inclusive, so it > > > needed to extend to the first day of the next month or else it > > > wouldn't be able to find objects from the last day of the current > > > month. > > > Yup. Here's the ticket, from not long after Django was released > > publicly (and also, I think, my first contribution): > >http://code.djangoproject.com/ticket/992 > > > -- > > "May the forces of evil become confused on the way to your house." > > -- George > > Carlinfromhttp://www.djangoproject.com/documentation/db_api/#range > range > > Range test (inclusive). > > Example: > > start_date = datetime.date(2005, 1, 1) > end_date = datetime.date(2005, 3, 31) > Entry.objects.filter(pub_date__range=(start_date, end_date)) > > SQL equivalent: > > SELECT ... WHERE pub_date BETWEEN '2005-01-01' and '2005-03-31'; > > You can use range anywhere you can use BETWEEN in SQL -- for dates, > numbers and even characters. > > perhaps > lookup_kwargs['%s__gte' % date_field] = first_day > lookup_kwargs['%s__lte' % date_field] = last_day > in place of > lookup_kwargs = {'%s__range' % date_field: (first_day, last_day)} > could settle the problem > > Thanks, James > jlT I have verified with Postgre Between x and y x and y are included and I think all other systems do the same cannot create a ticket (rejected by spam filter even with mail adress) Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
