port to new django, AI automated
This commit is contained in:
@@ -1,4 +1,31 @@
|
||||
from django.contrib import admin
|
||||
from simpleforum.models import Message
|
||||
|
||||
admin.site.register(Message)
|
||||
from .models import Message
|
||||
|
||||
|
||||
@admin.register(Message)
|
||||
class MessageAdmin(admin.ModelAdmin):
|
||||
"""Admin configuration for Message model."""
|
||||
|
||||
list_display = ("titel", "author", "creation_time")
|
||||
list_filter = ("creation_time", "author")
|
||||
search_fields = ("titel", "text", "author__username")
|
||||
date_hierarchy = "creation_time"
|
||||
ordering = ("-creation_time",)
|
||||
readonly_fields = ("creation_time",)
|
||||
|
||||
fieldsets = (
|
||||
(
|
||||
None,
|
||||
{
|
||||
"fields": ("titel", "text", "author"),
|
||||
},
|
||||
),
|
||||
(
|
||||
"Metadata",
|
||||
{
|
||||
"fields": ("creation_time",),
|
||||
"classes": ("collapse",),
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user