#10071 closed (fixed)
month and day lookup arguments should be integers
Reported by: | Leo Soto M. | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.0 |
Severity: | Keywords: | jython | |
Cc: | Jacob | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
On [8131] we forgot to normalize month and day lookups to be passed as a consistent type to the backend. Later, on [8494] and [8526] they were normalized as unicode, apparently to avoid problems with SQLite.
This is a problem for backends which are strict in terms of the argument data types. Specifically, on PostgreSQL and JDBC, it doesn't work if you compare the year of a date column against an string. Also, I don't see how to fix the problem on the backend layer, as it doesn't seem to have a chance to do the needed type conversion.
Now, considering than months and day numbers are, well, numbers, int sounds like a better type than unicode for interfacing with the backend. The attached patch does this change, without breaking the sqlite3 backend.
Attachments (2)
Change History (9)
by , 16 years ago
Attachment: | month_and_day_lookups_as_ints.diff added |
---|
comment:1 by , 16 years ago
comment:2 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 16 years ago
Component: | Uncategorized → Database layer (models, ORM) |
---|
comment:4 by , 16 years ago
Cc: | added |
---|
Just a reminder that this is an important bug on jython and should be backported to the next 1.0.X release
by , 16 years ago
Attachment: | 10071-month_day_weekday_lookups_as_ints-r10454.diff added |
---|
Updated Leo's patch to post-week_day lookup adition (r9818)
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [10530]) Fixed #10071 -- Changed some internal database data representations.
We now pass numbers used in data queries as actualy numbers (integers) to the
database backends, rather than string forms. This is easier for some of the
less flexible backeds.
Based on a patch from Leo Soto and Ramiro Morales.
comment:6 by , 16 years ago
(In [10531]) [1.0.X] Fixed #10071 -- Changed some internal database data representations.
We now pass numbers used in data queries as actualy numbers (integers) to the
database backends, rather than string forms. This is easier for some of the
less flexible backeds.
Patch from Leo Soto.
Backport of r10530 from trunk.
As reference, mailing discussion is here: http://groups.google.com/group/django-developers/browse_thread/thread/db56e53fac0d1fa6