konova/news/admin.py
mpeltriaux 5b0b376405 #99 Admin backend cleanup
* removes admin backend views which are not important for production
* adds filtering functionalities on index views
* simplifies detail views on intervention, compensation, ecoaccount and ema
* adds autocomplete fields on detail views
* adds handy horizontal filter fields on detail views
2022-02-01 18:41:02 +01:00

27 lines
485 B
Python

from django.contrib import admin
from news.models import ServerMessage
class ServerMessageAdmin(admin.ModelAdmin):
readonly_fields = [
"modified",
"created",
]
list_display = [
"id",
"subject",
"publish_on",
"is_active",
]
search_fields = [
"subject"
]
def save_model(self, request, obj, form, change):
obj.save(user=request.user)
admin.site.register(ServerMessage, ServerMessageAdmin)