Fixed #15961 -- Added get_search_results to ModelAdmin #1166

Merged
merged 1 commit into from May 19, 2013

Conversation

Projects
None yet
4 participants
@bbenko
Contributor

bbenko commented May 19, 2013

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

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.

freakboy3742 added a commit that referenced this pull request May 19, 2013

Merge pull request #1166 from bbenko/ticket_15961
Fixed #15961 -- Added get_search_results to ModelAdmin

@freakboy3742 freakboy3742 merged commit c0719d0 into django:master May 19, 2013

@loic

This comment has been minimized.

Show comment
Hide comment
@loic

loic Aug 3, 2013

Member

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

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

@timgraham

This comment has been minimized.

Show comment
Hide comment
@timgraham

timgraham Dec 28, 2015

Member

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?

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