Changes between Initial Version and Version 1 of Ticket #18176, comment 2


Ignore:
Timestamp:
Apr 28, 2012, 4:03:49 PM (12 years ago)
Author:
rrotaru

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18176, comment 2

    initial v1  
    11It turns out that python interprets numbers with leading zeroes as octal input (hence why anything with a leading zero that also contains an 8 or 9 causes an invalid token error). It seems like allowing strings to be passed in year lookups would solve both issues and might be the most reasonable approach.
     2
     3Note: !__year lookup already supports strings, however something along the lines of
     4{{{
     5Poll.objects.filter(pub_date__year='0999')
     6}}}
     7Still generates the following query in SQLite:
     8{{{
     9{'sql': u'SELECT "polls_poll"."id", "polls_poll"."question", "polls_poll"."pub_date" FROM "polls_poll" WHERE "polls_poll"."pub_date" BETWEEN 999-01-01 and 999-12-31 23:59:59.999999 LIMIT 21',
     10  'time': '0.000'}]
     11}}}
     12(Notice how the years still lack the leading zeroes. This seems to be mainly an issue in SQLite.)
Back to Top