Opened 18 years ago
Closed 15 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: | dev |
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 |
Description
Environment:
Python 2.4.2
sqlite3 3.2.1
pysqlite 2.3.1
Attachments (2)
Change History (8)
by , 18 years ago
Attachment: | date-based-generic-view_date-field.diff added |
---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
This patch works also for me, I had the same problem with date/datetime fields in SQLite3. See this thread on googlegroups.
comment:3 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 18 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
The bug persists in the newest version (subversion 3916) with sqlite-3.3.5, pysqlite-2.3.1, python-2.4.3
comment:5 by , 18 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Patch must need improvement if the bug persists :)
by , 15 years ago
Attachment: | bug_2471.tar added |
---|
Tar ball of Django app that shows non-reproducibility of bug
comment:6 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
Bug not reproducible with python 2.6, sqlite3, and jango-trunk. See attached tar ball.
python manage.py syncdb
python manage.py runserver
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/date_based.py) to test if it's dealing with a DateField or a DateTimeField and build the sql lookup args depending on that.