django-orchestra/orchestra/contrib/mailer/actions.py
2016-05-11 12:56:10 +00:00

9 lines
264 B
Python

from django.core.urlresolvers import reverse
from django.shortcuts import redirect
def last(modeladmin, request, queryset):
last = queryset.model.objects.latest('id')
url = reverse('admin:mailer_message_change', args=(last.pk,))
return redirect(url)