|
|
|
@ -5,7 +5,7 @@ from django.utils.translation import gettext_lazy as _ |
|
|
|
from rest_framework.authtoken.models import TokenProxy |
|
|
|
from ajaxdatatable.admin import AjaxDatatable |
|
|
|
|
|
|
|
from apps.account.models import User |
|
|
|
from apps.account.models import User, Notification |
|
|
|
from django import forms |
|
|
|
from django.contrib import admin |
|
|
|
from django.urls import path, reverse |
|
|
|
@ -15,6 +15,15 @@ from django.contrib import messages |
|
|
|
from apps.account.models import ClientUser, AdminUser |
|
|
|
|
|
|
|
|
|
|
|
@admin.register(Notification) |
|
|
|
class NotificationAdmin(AjaxDatatable): |
|
|
|
list_display = ('title', 'user', 'is_read', 'created_at') |
|
|
|
list_filter = ('is_read', 'created_at') |
|
|
|
search_fields = ('title', 'message', 'user__fullname') |
|
|
|
list_editable = ('is_read',) |
|
|
|
ordering = ('-created_at',) |
|
|
|
autocomplete_fields = ['user',] |
|
|
|
|
|
|
|
|
|
|
|
@admin.register(User) |
|
|
|
class UserAdmin(UserAdmin, AjaxDatatable): |
|
|
|
|