7016 add search indexes

This commit is contained in:
Arthur 2022-09-19 13:47:46 -07:00
parent 3afec02055
commit 8bfb1665ac

View 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(),
}