1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Jeremy Stretch 3d20276f55 Closes #14134: Display additional object attributes in global search results (#14154)
* WIP

* Add display_attrs for all indexers

* Linkify object attributes

* Clean up prefetch logic

* Use tooltips for display attributes

* Simplify template code

* Introduce get_indexer() utility function

* Add  to examples in docs

* Use tooltips to display long strings
2023-11-09 16:21:09 -05:00

23 lines
471 B
Python

from netbox.search import SearchIndex, register_search
from . import models
@register_search
class DataSourceIndex(SearchIndex):
model = models.DataSource
fields = (
('name', 100),
('source_url', 300),
('description', 500),
('comments', 5000),
)
display_attrs = ('type', 'status', 'description')
@register_search
class DataFileIndex(SearchIndex):
model = models.DataFile
fields = (
('path', 200),
)