mpeltriaux
5b0b376405
* 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
27 lines
485 B
Python
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)
|
|
|