forked from mirror/django-mailbox
Add admin support for attachments
This commit is contained in:
parent
645a723d09
commit
00c14e9818
1 changed files with 5 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
|||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
|
||||
from django_mailbox.models import Message, Mailbox
|
||||
from django_mailbox.models import MessageAttachment, Message, Mailbox
|
||||
|
||||
def get_new_mail(mailbox_admin, request, queryset):
|
||||
for mailbox in queryset.all():
|
||||
|
|
@ -17,6 +17,9 @@ class MailboxAdmin(admin.ModelAdmin):
|
|||
)
|
||||
actions = [get_new_mail]
|
||||
|
||||
class MessageAttachmentAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
class MessageAdmin(admin.ModelAdmin):
|
||||
list_display = (
|
||||
'subject',
|
||||
|
|
@ -35,4 +38,5 @@ class MessageAdmin(admin.ModelAdmin):
|
|||
|
||||
if getattr(settings, 'DJANGO_MAILBOX_ADMIN_ENABLED', True):
|
||||
admin.site.register(Message, MessageAdmin)
|
||||
admin.site.register(MessageAttachmentAdmin, MessageAttachment)
|
||||
admin.site.register(Mailbox, MailboxAdmin)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue