On Mon, 2007-03-19 at 14:09 +0000, abe wrote:
> I'm getting unexpected (missing) results from the __search field
> lookup
> it looks like it can only finds whole words, but only if they're
> larger than
> 3 chars. is this correct? and is it supposed to work like this?
>
>
> In [65]: c.choice='ABC123\ncde456'
>
> In [66]: c.save()
>
> In [67]: Choice.objects.filter(choice__search='abc123')
> Out[67]:
> [ABC123
> cde456]
>
> In [68]: c.choice='ABC\ncde'
>
> In [69]: c.save()
>
> In [70]: Choice.objects.filter(choice__search='abc')
> Out[70]: []
That's not what I would have expected to see. Have a look at the SQL
that Django is generating and see if there are any clues there. To do
that, make sure you have DEBUG=True in your settings file (which you
will have by default) and then do this:
from django.db import connection
connection.query[-1]['sql']
(from the interactive prompt). The connection.query object is a list of
all the SQL queries from the session -- or a single request if you are
using it in webserver mode.
Regards,
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---