DRF_Template/backend/search_results/admin.py

19 lines
501 B
Python
Raw Normal View History

from django.contrib import admin
2024-10-31 00:33:13 +08:00
from unfold.admin import ModelAdmin
from unfold.contrib.filters.admin import RangeDateFilter
2024-10-31 00:33:13 +08:00
from .models import SearchResult
@admin.register(SearchResult)
class SearchResultAdmin(ModelAdmin):
model = SearchResult
search_fields = ("id", "title", "link")
list_display = ["id", "title", "timestamp"]
list_filter_submit = True
list_filter = (
("timestamp", RangeDateFilter),
("timestamp", RangeDateFilter),
)