From db2dc108e52ddd7432fc0d5bd68433ffe086ae5b Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Sun, 8 Mar 2009 05:49:08 +0000 Subject: [PATCH] Fixes issue #52: Add message to search screen if system is running sqlite. --- README | 3 +++ templates/helpdesk/ticket_list.html | 1 + views/staff.py | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/README b/README index 3cfba4fb..544a7cdb 100644 --- a/README +++ b/README @@ -39,6 +39,9 @@ case-insensitive searches. It's recommended that you use PostgreSQL or MySQL if possible. For more information, see this note in the Django documentation: http://docs.djangoproject.com/en/dev/ref/databases/#sqlite-string-matching +When you try to do a keyword search using sqlite, a message will be displayed +to alert you to this shortcoming. There is no way around it, sorry. + ######################### 3. Upgrading from previous versions ######################### diff --git a/templates/helpdesk/ticket_list.html b/templates/helpdesk/ticket_list.html index 221098a4..33ac4488 100644 --- a/templates/helpdesk/ticket_list.html +++ b/templates/helpdesk/ticket_list.html @@ -111,6 +111,7 @@ $(document).ready(function() { +{{ search_message|safe }} diff --git a/views/staff.py b/views/staff.py index 515a2e46..1c186f99 100644 --- a/views/staff.py +++ b/views/staff.py @@ -386,6 +386,10 @@ def ticket_list(request): tickets = apply_query(Ticket.objects.select_related(), query_params) + search_message = '' + if context.has_key('query') and settings.DATABASE_ENGINE.startswith('sqlite'): + search_message = _('

Note: Your keyword search is case sensitive because of your database. This means the search will not be accurate. By switching to a different database system you will gain better searching! For more information, read the Django Documentation on string matching in SQLite.') + import cPickle from helpdesk.lib import b64encode urlsafe_query = b64encode(cPickle.dumps(query_params)) @@ -403,6 +407,7 @@ def ticket_list(request): user_saved_queries=user_saved_queries, query_params=query_params, from_saved_query=from_saved_query, + search_message=search_message, ))) ticket_list = staff_member_required(ticket_list)

{% trans "Tickets" %}
#{% trans "Pr" %}{% trans "Title" %}{% trans "Queue" %}{% trans "Status" %}{% trans "Created" %}{% trans "Owner" %}