month and day lookup arguments should be integers
|Reported by:||leosoto||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)
Changed 5 years ago by leosoto
comment:1 Changed 5 years ago by leosoto
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 5 years ago by jacob
- milestone set to 1.1
- Triage Stage changed from Unreviewed to Accepted
comment:3 Changed 5 years ago by russellm
- Component changed from Uncategorized to Database layer (models, ORM)
Changed 5 years ago by ramiro
comment:5 Changed 5 years ago by mtredinnick
- Resolution set to fixed
- Status changed from new to closed