2016-05-09 12:02:10 +00:00
|
|
|
from django.core.urlresolvers import reverse
|
|
|
|
from django.shortcuts import redirect
|
|
|
|
|
|
|
|
|
|
|
|
def last(modeladmin, request, queryset):
|
2016-05-11 12:56:10 +00:00
|
|
|
last = queryset.model.objects.latest('id')
|
|
|
|
url = reverse('admin:mailer_message_change', args=(last.pk,))
|
2016-05-09 12:02:10 +00:00
|
|
|
return redirect(url)
|