Ticket #13282: 13282.diff

File 13282.diff, 1015 bytes (added by wangchun, 14 years ago)
  • docs/ref/models/querysets.txt

     
    15681568
    15691569Example::
    15701570
    1571     Entry.objects.filter(pub_date__week_day=2)
     1571    Entry.objects.filter(pub_date__week_day=1)
    15721572
    15731573SQL equivalent::
    15741574
    1575     SELECT ... WHERE EXTRACT('dow' FROM pub_date) = '2';
     1575    SELECT ... WHERE EXTRACT('dow' FROM pub_date) = '1';
    15761576
    15771577(The exact SQL syntax varies for each database engine.)
    15781578
    1579 Note this will match any record with a pub_date that falls on a Monday (day 2
    1580 of the week), regardless of the month or year in which it occurs. Week days
    1581 are indexed with day 1 being Sunday and day 7 being Saturday.
     1579Note this will match any record with a pub_date that falls on a Monday (the
     1580second day of the week), regardless of the month or year in which it occurs.
     1581Week days are indexed with day 0 being Sunday and day 6 being Saturday.
    15821582
    15831583.. fieldlookup:: isnull
    15841584
Back to Top