Re: Backend-specific lookups

2014-11-17 Thread Shai Berger
I just wanted to drop a line here saying "it will take me another couple of days to deal with this". On one hand, I want to wait with this for Marc's work to land. On the other, there are more urgent issues even in Oracle-land (the broken Py3 tests). And yes, I'm with Anssi on removing get_db_p

Re: Backend-specific lookups

2014-11-16 Thread Anssi Kääriäinen
A possible solution is to just register a custom as_vendor method in the backend's initialization code. You could also alter Oracle's compiler.compile() method to check for backend specific implementation class, and use that instead of the original one. Something like: backend_lookup_overrides =

Re: Backend-specific lookups

2014-11-16 Thread Marc Tamlyn
The test failures on the CI would suggest that overriding `get_db_prep_lookup` is a problem! There are changes on my ranges branch which move the % sign addition out of `Field.get_db_prep_lookup` and into the relevant lookup. This makes overriding certain lookups (e.g. contains, startswith etc) mu

Re: Backend-specific lookups

2014-11-16 Thread Shai Berger
On Sunday 16 November 2014 00:46:43 Josh Smeaton wrote: > Clever. I don't mind this approach at all. Will the overriding of > get_db_prep_lookup interfere with other implementations though? > Yes, it probably would. It is there because the default one for the lookup adds % signs around the value

Re: Backend-specific lookups

2014-11-15 Thread Michael Manfre
Overriding get_db_prep_lookup seems like it would cause problems. Even if were only registered when Oracle is in use, that would make multi-db with Oracle as one of the backends problematic. On Sat, Nov 15, 2014 at 5:46 PM, Josh Smeaton wrote: > Clever. I don't mind this approach at all. Will th

Re: Backend-specific lookups

2014-11-15 Thread Josh Smeaton
Clever. I don't mind this approach at all. Will the overriding of get_db_prep_lookup interfere with other implementations though? On Sunday, 16 November 2014 06:03:18 UTC+11, Shai Berger wrote: > > Hi, > > I'v been working on an old Oracle bug[1], and realized that a nice way to > solve it woul

Re: Backend-specific lookups

2014-11-15 Thread Claude Paroz
Hi Shai, I was thinking about something very similar for the GIS backends, where this question is even more accurate, as lookup implementations are often very backend-specific. I was experimenting with dynamic mixin registration, but that felt very hackish [1]. Anyway, a solution to this use c

Backend-specific lookups

2014-11-15 Thread Shai Berger
Hi, I'v been working on an old Oracle bug[1], and realized that a nice way to solve it would be by overriding some builtin lookups with custom lookups for Oracle. However, I had some doubts about where to place the code: On the one hand, I could just add an "as_oracle()" to the builtin lookup