While resuming the Django/Jython work, I've been hit by a small
inconsistency on the types of lookup arguments, as received by DB
backends.

Basically, __year lookup arguments are converted to integers before
being passed to the backend, but for __month and __day it's unicode.
That's weird. And for JDBC backends which are picky about types (like
on PostgreSQL where operators may have specialized meanings for
different types) string arguments won't work.

Now, the blame is on my side here: I didn't saw this situation while
working on #7560[1] and just assumed that lookup arguments were always
integers. Later, when it was clear than unicode arguments should also
be supported (because the admin uses that), changesets 8424[2] and
8526[3] fixed the existing problems. Unfortunately, always passing
unicode to the backend was (part of) the solution. But looks like
normalizing to int should also work.

So I've uploaded a small patch on #10071[4] which does the
normalization to int instead of unicode. I tested it with sqlite
(which was the problematic backend) and it doesn't break any test.

Now, my questions are:

 - Is this change OK or would it be considered as backwards
incompatible for slightly changing the interface with DB backends? On
the pragmatic side I'd like to point that this doesn't break anything
on the built-in backends but it would be good get confirmation from
other external backend developers.

 - If the change is OK, could it make it into the 1.0.X branch? That'd
be very good, as we are targeting Django 1.0 on the django-jython
project.

 - Anyone else with other version of sqlite (I'm using 3.5.9) who
would like to test if the patch works?

 - Am I missing something here?

Regards,

[1] http://code.djangoproject.com/ticket/7560
[2] http://code.djangoproject.com/changeset/8494
[3] http://code.djangoproject.com/changeset/8526
[4] http://code.djangoproject.com/ticket/10071
-- 
Leo Soto M.
http://blog.leosoto.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to