Opened 9 years ago

Closed 22 months ago

Last modified 22 months 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


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 Changed 9 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by Peter Baumgartner

Severity: Normal
Type: New feature

comment:3 Changed 7 years ago by Aymeric Augustin

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 Changed 22 months ago by Simon Charette

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 Changed 22 months ago by Simon Charette

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