On Mar 11, 4:33 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 3/11/07, Laurie <[EMAIL PROTECTED]> wrote: > > > I don't think there's any way to get Django to log the SQL it's > > executing, so I don't know if it's issuing any 'WHERE x ILIKE y' type > > clauses, but functionally I'm not getting search filtering. > > When the DEBUG setting is True, Django keeps a list of all the queries > it's executed; you can see them by doing > > from django.db import connection > print connection.queries
Ah, that might help if I can figure out where to call it from... Is the list preserved across requests? Could I implement a view that I could hit whenever I need to check 'what just happened to the database'? > For searching in the admin, the default is to use the 'contains' > keyword filter on the QuerySet, which translates to 'LIKE %term%' in > the SQL. You can alter this behavior by adding operators to your > search terms: > > ^ at the start of a term turns it into a 'startswith' filter ('LIKE term%') > @ will cause it to use a full-text index search (currently only > supported on MySQL) > = before a term makes it look for an exact match. Yup, I tried a regular constraint and an ^constraint. In both cases, the result of a search is all items; no filtering/restriction of the view happens. If I can figure out where to put the 'print connection.queries' statement, I'll see whether the admin UI is actually the search criteria to its queries. L. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---