def random_mac(request, virttype='xenpv'):
 if (not test_user_authenticated(request)):
  return login(request, expired=True)
 random_mac = remote.get_random_mac(virttype, request.session['token'])
 return HttpResponse(random_mac)

def random_mac ( request , virttype = 'xenpv' ) : if ( not test_user_authenticated ( request ) ) : return login ( request , expired = True ) random_mac = remote . get_random_mac ( virttype , request . session [ 'token' ] ) return HttpResponse ( random_mac )
used in an ajax call to fill in a field with a mac address .