2024-09-24 16:08:28 +08:00
|
|
|
from unfold.admin import ModelAdmin
|
|
|
|
from django.contrib import admin
|
|
|
|
from .models import SearchResult
|
2024-09-24 16:09:47 +08:00
|
|
|
from unfold.contrib.filters.admin import RangeDateFilter
|
2024-09-24 16:08:28 +08:00
|
|
|
|
|
|
|
|
|
|
|
@admin.register(SearchResult)
|
|
|
|
class SearchResultAdmin(ModelAdmin):
|
|
|
|
model = SearchResult
|
2024-10-30 22:09:58 +08:00
|
|
|
search_fields = ("id", "title", "link")
|
|
|
|
list_display = ["id", "title", "timestamp"]
|
2024-09-24 16:09:47 +08:00
|
|
|
|
|
|
|
list_filter_submit = True
|
2024-10-30 22:09:58 +08:00
|
|
|
list_filter = (
|
|
|
|
("timestamp", RangeDateFilter),
|
|
|
|
("timestamp", RangeDateFilter),
|
|
|
|
)
|