mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2024-11-17 04:09:25 +08:00
18 lines
501 B
Python
18 lines
501 B
Python
from django.contrib import admin
|
|
from unfold.admin import ModelAdmin
|
|
from unfold.contrib.filters.admin import RangeDateFilter
|
|
|
|
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),
|
|
)
|