def scan_host(modeladmin, request, queryset): for host in queryset: scan_host_key(host.hostname)
def save_host(sender, instance, created, *args, **kwargs): if created: scan_host_key(instance.hostname)