def get_search_fields(self):
    "\n        Returns the search field names mapped to weights as a dict.\n        Used in ``get_queryset`` below to tell ``SearchableQuerySet``\n        which search fields to use. Also used by ``DisplayableAdmin``\n        to populate Django admin's ``search_fields`` attribute.\n\n        Search fields can be populated via\n        ``SearchableManager.__init__``, which then get stored in\n        ``SearchableManager._search_fields``, which serves as an\n        approach for defining an explicit set of fields to be used.\n\n        Alternatively and more commonly, ``search_fields`` can be\n        defined on models themselves. In this case, we look at the\n        model and all its base classes, and build up the search\n        fields from all of those, so the search fields are implicitly\n        built up from the inheritence chain.\n\n        Finally if no search fields have been defined at all, we\n        fall back to any fields that are ``CharField`` or ``TextField``\n        instances.\n        "
    search_fields = self._search_fields.copy()
    if (not search_fields):
        for cls in reversed(self.model.__mro__):
            super_fields = getattr(cls, 'search_fields', {})
            search_fields.update(search_fields_to_dict(super_fields))
    if (not search_fields):
        search_fields = []
        for f in self.model._meta.fields:
            if isinstance(f, (CharField, TextField)):
                search_fields.append(f.name)
        search_fields = search_fields_to_dict(search_fields)
    return search_fields
Returns the search field names mapped to weights as a dict.
Used in ``get_queryset`` below to tell ``SearchableQuerySet``
which search fields to use. Also used by ``DisplayableAdmin``
to populate Django admin's ``search_fields`` attribute.

Search fields can be populated via
``SearchableManager.__init__``, which then get stored in
``SearchableManager._search_fields``, which serves as an
approach for defining an explicit set of fields to be used.

Alternatively and more commonly, ``search_fields`` can be
defined on models themselves. In this case, we look at the
model and all its base classes, and build up the search
fields from all of those, so the search fields are implicitly
built up from the inheritence chain.

Finally if no search fields have been defined at all, we
fall back to any fields that are ``CharField`` or ``TextField``
instances.
def get_search_fields(self):
    "\n        Returns the search field names mapped to weights as a dict.\n        Used in ``get_queryset`` below to tell ``SearchableQuerySet``\n        which search fields to use. Also used by ``DisplayableAdmin``\n        to populate Django admin's ``search_fields`` attribute.\n\n        Search fields can be populated via\n        ``SearchableManager.__init__``, which then get stored in\n        ``SearchableManager._search_fields``, which serves as an\n        approach for defining an explicit set of fields to be used.\n\n        Alternatively and more commonly, ``search_fields`` can be\n        defined on models themselves. In this case, we look at the\n        model and all its base classes, and build up the search\n        fields from all of those, so the search fields are implicitly\n        built up from the inheritence chain.\n\n        Finally if no search fields have been defined at all, we\n        fall back to any fields that are ``CharField`` or ``TextField``\n        instances.\n        "
    search_fields = self._search_fields.copy()
    if (not search_fields):
        for cls in reversed(self.model.__mro__):
            super_fields = getattr(cls, 'search_fields', {})
            search_fields.update(search_fields_to_dict(super_fields))
    if (not search_fields):
        search_fields = []
        for f in self.model._meta.fields:
            if isinstance(f, (CharField, TextField)):
                search_fields.append(f.name)
        search_fields = search_fields_to_dict(search_fields)
    return search_fields