mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 00:15:17 -06:00
7016 add search indexes
This commit is contained in:
parent
3afec02055
commit
8bfb1665ac
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