On 18 touko, 17:46, Shai Berger <[email protected]> wrote:
> Hi django devs,
>
> While going through Oracle bugs, I ran into the ticket in the subject[0]. The
> problem there is that current code assumes that whenever we want to compare
> anything (pretty much) against a datetime column, in any way, we'd like to
> compare the column value and the given value as datetimes. Of course, in the
> case of lookup_date_as_str -- lookup types like 'startswith' -- this is not
> the case.
>
> I want to fix things so that for the relevant lookup types, the comparison 
> will
> not try to force anything into a date. I see at least two ways to do that, but
> they share ugliness: They take a place in general code which special-cases
> datetimes, and add an extra special-casing for the lookup types. The fix (in
> each of the ways I see) is less than 5 lines of code, but, euh.
>
> So, two questions arise:
>
> 1) The fixes I see would affect all backends, but AFAIK only Oracle is 
> reported
> as failing the test; anyone wants to comment on this? Do all other backends
> just not need a cast_to_date operation?
>
> 2) Should I fix it in the ugly ways, or look for a more general solution, 
> which
> will involve deeper changes?

I don't think it is necessary to do deeper changes. My interpretation
of the current lookup system is that it has been stretched to its
limits and needs to be refactored. I intended to do that already for
the 1.6 release but ran out of steam.

Of course, if you want to do improvements to current code that isn't
forbidden... But don't feel obligated to do so.

I am not sure about question 1 except that changing the backend API to
make Oracle work is OK.

 - Anssi

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


Reply via email to