mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-22 23:46:44 -06:00
Add search indexers
This commit is contained in:
parent
21f1de4fa0
commit
fd432e023d
@ -0,0 +1,65 @@
|
||||
from netbox.search import SearchIndex, register_search
|
||||
from . import models
|
||||
|
||||
|
||||
@register_search
|
||||
class TunnelIndex(SearchIndex):
|
||||
model = models.Tunnel
|
||||
fields = (
|
||||
('name', 100),
|
||||
('tunnel_id', 300),
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('status', 'encapsulation', 'tenant', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
class IKEProposalIndex(SearchIndex):
|
||||
model = models.IKEProposal
|
||||
fields = (
|
||||
('name', 100),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('description',)
|
||||
|
||||
|
||||
@register_search
|
||||
class IKEPolicyIndex(SearchIndex):
|
||||
model = models.IKEPolicy
|
||||
fields = (
|
||||
('name', 100),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('description',)
|
||||
|
||||
|
||||
@register_search
|
||||
class IPSecProposalIndex(SearchIndex):
|
||||
model = models.IPSecProposal
|
||||
fields = (
|
||||
('name', 100),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('description',)
|
||||
|
||||
|
||||
@register_search
|
||||
class IPSecPolicyIndex(SearchIndex):
|
||||
model = models.IPSecPolicy
|
||||
fields = (
|
||||
('name', 100),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('description',)
|
||||
|
||||
|
||||
@register_search
|
||||
class IPSecProfileIndex(SearchIndex):
|
||||
model = models.IPSecProfile
|
||||
fields = (
|
||||
('name', 100),
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('description',)
|
Loading…
Reference in New Issue
Block a user