Skip to content

Fixed #15961 -- Added get_search_results to ModelAdmin #1166

Merged
merged 1 commit into from May 19, 2013

4 participants

@bbenko
bbenko commented May 19, 2013

This adds the get_search_results entry point to make the admin search more customisable.

@bbenko bbenko Fixed #15961 -- Modified ModelAdmin to allow for custom search methods.
This adds a get_search_results method that users can override to
provide custom search strategies.

Thanks to Daniele Procida for help with the docs.
2d309a7
@freakboy3742 freakboy3742 merged commit c0719d0 into django:master May 19, 2013
@loic

Does this method really need to be on BaseModelAdmin or should it be ModelAdmin?

@timgraham

Hi @bbenko, this example came up in #5883 and as far as I can tell, there's no need for a custom get_search_results() method if you want to search by integer field (i.e. adding 'age' to search_fields should is equivalent). Did I miss something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.