Opened 13 years ago

Closed 10 years ago

#2471 closed defect (invalid)

[patch] date_based generic view doesn't work with DateField and sqlite

Reported by: Steven Armstrong Owned by: nobody
Component: Generic views Version: master
Severity: major Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


Python 2.4.2
sqlite3 3.2.1
pysqlite 2.3.1

Attachments (2)

date-based-generic-view_date-field.diff (1.7 KB) - added by Steven Armstrong 13 years ago.
bug_2471.tar (4.2 KB) - added by hughdbrown@… 10 years ago.
Tar ball of Django app that shows non-reproducibility of bug

Download all attachments as: .zip

Change History (8)

Changed 13 years ago by Steven Armstrong

comment:1 Changed 13 years ago by Steven Armstrong

In MySQL and friends a DateField is represented as '2006-08-07 00:00:00'
while in sqlite it's just '2006-08-07'.

The patch changes the archive_day view (django/views/generic/ to test if it's dealing with a DateField or a DateTimeField and build the sql lookup args depending on that.

comment:2 Changed 13 years ago by jarek.zgoda@…

This patch works also for me, I had the same problem with date/datetime fields in SQLite3. See this thread on googlegroups.

comment:3 Changed 13 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [3633]) Fixed #2471 -- Got date-based generic views working with SQLite DateFields. Thanks for the patch, Steven Armstrong

comment:4 Changed 13 years ago by js(AT)

Resolution: fixed
Status: closedreopened

The bug persists in the newest version (subversion 3916) with sqlite-3.3.5, pysqlite-2.3.1, python-2.4.3

comment:5 Changed 12 years ago by Gary Wilson <gary.wilson@…>

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Patch must need improvement if the bug persists :)

Changed 10 years ago by hughdbrown@…

Attachment: bug_2471.tar added

Tar ball of Django app that shows non-reproducibility of bug

comment:6 Changed 10 years ago by anonymous

Resolution: invalid
Status: reopenedclosed

Bug not reproducible with python 2.6, sqlite3, and jango-trunk. See attached tar ball.

python syncdb
python runserver


Note: See TracTickets for help on using tickets.
Back to Top