mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 08:25:17 -06:00
7016 add search indexes
This commit is contained in:
parent
c6aa03f59d
commit
0457a647c7
19
netbox/extras/search_indexes.py
Normal file
19
netbox/extras/search_indexes.py
Normal file
@ -0,0 +1,19 @@
|
||||
import dcim.filtersets
|
||||
import dcim.tables
|
||||
from django.db import models
|
||||
from extras.models import JournalEntry
|
||||
from search.models import SearchMixin
|
||||
|
||||
|
||||
class JournalEntryIndex(SearchMixin):
|
||||
def __init__(self):
|
||||
self.model = JournalEntry
|
||||
self.queryset = JournalEntry.objects.prefetch_related('assigned_object', 'created_by')
|
||||
self.filterset = extras.filtersets.JournalEntryFilterSet
|
||||
self.table = extras.tables.JournalEntryTable
|
||||
self.url = 'extras:journalentry_list'
|
||||
|
||||
|
||||
JOURNAL_SEARCH_TYPES = {
|
||||
'journalentry': JournalEntryIndex(),
|
||||
}
|
Loading…
Reference in New Issue
Block a user