django-orchestra/orchestra/contrib/mailer/admin.py

24 lines
550 B
Python
Raw Normal View History

2015-05-04 19:52:53 +00:00
from django.contrib import admin
from orchestra.admin.utils import admin_link
from .models import Message, SMTPLog
class MessageAdmin(admin.ModelAdmin):
list_display = (
'id', 'state', 'priority', 'to_address', 'from_address', 'created_at', 'retries', 'last_retry'
)
class SMTPLogAdmin(admin.ModelAdmin):
list_display = (
'id', 'message_link', 'result', 'date', 'log_message'
)
message_link = admin_link('message')
admin.site.register(Message, MessageAdmin)
admin.site.register(SMTPLog, SMTPLogAdmin)