month and day lookup arguments should be integers
|Reported by:||Leo Soto M.||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.0|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
On  we forgot to normalize month and day lookups to be passed as a consistent type to the backend. Later, on  and  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.
Change History (9)
comment:1 Changed 8 years ago by
|Patch needs improvement:||unset|
Changed 7 years ago by