django-firebird backend

17 views
Skip to first unread message

maxi

unread,
Sep 28, 2009, 5:26:14 PM9/28/09
to Django developers
Hi,
I'm working on implementation of firebird backend for django [1]
I've an issue related of icontains filter option. Firebird uses
CONTAINING sql clause for this, which is case insesitive.

The problem is that the output generated (where clause) is wrong.
It return:

WHERE "TABLE"."FIELD" CONTAINING %value%

And, the correct form should be:

WHERE "TABLE"."FIELD" CONTAINING ' value '

It is using % instead '

The question is, which method I have to touch to change this
behavior?

Thanks in advance.
--
Maxi.

[1] http://code.google.com/p/django-firebird/





Ramiro Morales

unread,
Sep 28, 2009, 11:06:11 PM9/28/09
to django-d...@googlegroups.com
On Mon, Sep 28, 2009 at 6:26 PM, maxi <maxir...@gmail.com> wrote:
>
> Hi,
> I'm working on implementation of firebird backend for django [1]
> I've an issue related of icontains filter option. Firebird uses
> CONTAINING sql clause for this, which is case insesitive.
>
> The problem is that the output generated (where clause) is wrong.
> It return:
>
>        WHERE "TABLE"."FIELD" CONTAINING %value%
>
> And, the correct form should be:
>
>      WHERE "TABLE"."FIELD" CONTAINING  ' value '
>
> It is using % instead '
>
> The question is,  which method I have to touch to change this
> behavior?

Take a look at the [1][2]'operators' attribute of the backend's
DatabaseWrapper class and the [3]lookup_cast() method of
the 'ops' attribute (usually an instance of a backend-provided
subclass of DatabaseOperations).

Both are [4]used for building that kind of queries.

HTH,

--
Ramiro Morales | http://rmorales.net

1. http://code.djangoproject.com/browser/django/trunk/django/db/backends/dummy/base.py?rev=11596#L39
2. http://code.djangoproject.com/browser/django/trunk/django/db/backends/sqlite3/base.py?rev=11596#L129
3. http://code.djangoproject.com/browser/django/trunk/django/db/backends/__init__.py?rev=11596#L229
4. http://code.djangoproject.com/browser/django/trunk/django/db/models/sql/where.py?rev=11596#L166

tsteinmaurer

unread,
Sep 29, 2009, 4:21:23 AM9/29/09
to Django developers
Maxi,

I do have a few bugfixes for the firebird-backend. How can we get in
touch?

Regards,
Thomas
Reply all
Reply to author
Forward
0 new messages