Opened 15 years ago

Closed 8 years ago

Last modified 8 years ago

#12033 closed New feature (wontfix)

ModelAdmin.search_fields throws exception when using @ for non mysql database

Reported by: Harro Owned by: nobody
Component: contrib.admin Version: 1.1
Severity: Normal Keywords: search_fields, fulltext, mysql, sqlite, error
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

So for the production environment I would really like to use the fulltext search capabilities the @ prefix offers, but for development we hardly use the search anyway. And most people will use sqlite anyway.

Django throwing an exception when using the @ option for a non mysql backend makes it impossible to keep your code the same.

I suggest when using @ for a non mysql backend django throws an error in the error log and the normal search is used.

Change History (5)

comment:1 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Peter Baumgartner, 14 years ago

Severity: Normal
Type: New feature

comment:3 by Aymeric Augustin, 13 years ago

Easy pickings: unset
UI/UX: unset

Note that full-text search will work in backends other than MySQL if they implement fulltext_search_sql, which is the topic of #3254.

comment:6 by Simon Charette, 8 years ago

Resolution: wontfix
Status: newclosed

The MySQL specific __search lookup and its @ search field reference have been deprecated.

It's now possible to override the ModelAdmin.get_search_results() to provide backend agnostic FTS.

comment:7 by Simon Charette, 8 years ago

Actually the @ -> __search conversion is still present in get_search_result() so could implement a SearchLookup that you register to both CharField and TextField and you could implement it on SQLite.

Note: See TracTickets for help on using tickets.
Back to Top