mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* 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
This commit is contained in:
@ -14,8 +14,11 @@ class MyModelIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('site', 'device', 'status', 'description')
|
||||
```
|
||||
|
||||
Fields listed in `display_attrs` will not be cached for search, but will be displayed alongside the object when it appears in global search results. This is helpful for conveying to the user additional information about an object.
|
||||
|
||||
To register one or more indexes with NetBox, define a list named `indexes` at the end of this file:
|
||||
|
||||
```python
|
||||
|
Reference in New Issue
Block a user