mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
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:
parent
b06f6c1618
commit
2d309a7043
7 changed files with 109 additions and 30 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue