2021-04-21 12:27:18 +00:00
|
|
|
from django.urls import reverse
|
2016-05-09 12:02:10 +00:00
|
|
|
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)
|