21 lines
516 B
Python
21 lines
516 B
Python
from __future__ import annotations
|
|||
|
|
|
||
|
|
from django.contrib import admin
|
||
|
|
|
||
|
|
from .models import SensitiveWord
|
||
|
|
|
||
|
|
|
||
|
|
@admin.register(SensitiveWord)
|
||
|
|
class SensitiveWordAdmin(admin.ModelAdmin):
|
||
|
|
list_display = (
|
||
|
|
"word",
|
||
|
|
"normalized_word",
|
||
|
|
"category",
|
||
|
|
"action",
|
||
|
|
"is_active",
|
||
|
|
"updated_at",
|
||
|
|
)
|
||
|
|
list_filter = ("category", "action", "is_active")
|
||
|
|
search_fields = ("word", "normalized_word", "category")
|
||
|
|
readonly_fields = ("normalized_word", "created_at", "updated_at")
|