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.
This commit is contained in:
Bozidar Benko 2013-05-19 10:52:29 +02:00
parent b06f6c1618
commit 2d309a7043
7 changed files with 109 additions and 30 deletions

View file

@ -591,6 +591,12 @@ class ComplexSortedPerson(models.Model):
age = models.PositiveIntegerField()
is_employee = models.NullBooleanField()
class PluggableSearchPerson(models.Model):
name = models.CharField(max_length=100)
age = models.PositiveIntegerField()
class PrePopulatedPostLargeSlug(models.Model):
"""
Regression test for #15938: a large max_length for the slugfield must not