def upload_as_json ( name , mylist ) : location = list ( IPList . objects . filter ( name ) ) if location : iplist = location [ 0 ] return iplist . upload ( json = mylist , as_type = 'json' )
send python list as json django
Upload the IPList as json payload .
def upload_as_json(name, mylist):
    """
    Upload the IPList as json payload. 

    :param str name: name of IPList
    :param list: list of IPList entries
    :return: None
    """
    location = list(IPList.objects.filter(name))
    if location:
        iplist = location[0]
        return iplist.upload(json=mylist, as_type='json')