final all done 2nd last plan before goign live
This commit is contained in:
40
backend/igny8_core/business/notifications/admin.py
Normal file
40
backend/igny8_core/business/notifications/admin.py
Normal file
@@ -0,0 +1,40 @@
|
||||
"""
|
||||
Notification Admin Configuration
|
||||
"""
|
||||
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin
|
||||
|
||||
from .models import Notification
|
||||
|
||||
|
||||
@admin.register(Notification)
|
||||
class NotificationAdmin(ModelAdmin):
|
||||
list_display = ['title', 'notification_type', 'severity', 'account', 'user', 'is_read', 'created_at']
|
||||
list_filter = ['notification_type', 'severity', 'is_read', 'created_at']
|
||||
search_fields = ['title', 'message', 'account__name', 'user__email']
|
||||
readonly_fields = ['created_at', 'updated_at', 'read_at']
|
||||
ordering = ['-created_at']
|
||||
|
||||
fieldsets = (
|
||||
('Notification', {
|
||||
'fields': ('account', 'user', 'notification_type', 'severity')
|
||||
}),
|
||||
('Content', {
|
||||
'fields': ('title', 'message', 'site')
|
||||
}),
|
||||
('Action', {
|
||||
'fields': ('action_url', 'action_label')
|
||||
}),
|
||||
('Status', {
|
||||
'fields': ('is_read', 'read_at')
|
||||
}),
|
||||
('Metadata', {
|
||||
'fields': ('metadata',),
|
||||
'classes': ('collapse',)
|
||||
}),
|
||||
('Timestamps', {
|
||||
'fields': ('created_at', 'updated_at'),
|
||||
'classes': ('collapse',)
|
||||
}),
|
||||
)
|
||||
Reference in New Issue
Block a user