Fixes issue #52: Add message to search screen if system is running sqlite.

This commit is contained in:
Ross Poulton 2009-03-08 05:49:08 +00:00
parent 9830e1c3c1
commit db2dc108e5
3 changed files with 9 additions and 0 deletions

3
README
View File

@ -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
#########################

View File

@ -111,6 +111,7 @@ $(document).ready(function() {
</form>
</div>
{{ search_message|safe }}
<table width='100%'>
<tr class='row_tablehead'><td colspan='7'>{% trans "Tickets" %}</td></tr>
<tr class='row_columnheads'><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Status" %}</th><th>{% trans "Created" %}</th><th>{% trans "Owner" %}</th></tr>

View File

@ -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 = _('<p><strong>Note:</strong> Your keyword search is case sensitive because of your database. This means the search will <strong>not</strong> be accurate. By switching to a different database system you will gain better searching! For more information, read the <a href="http://docs.djangoproject.com/en/dev/ref/databases/#sqlite-string-matching">Django Documentation on string matching in SQLite</a>.')
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)