ajax request python array list
Question: I am making ajax call and fetching details in python and saving it in mongodb.

**Scenario:** I tried `request.POST.getlist('arrayList[]')`

> _Works:_ if array contains values inside it. Eg: ['abcd', '1234']
>
> **_Doesn't work:_** if array contains arrays inside it. Eg: [[arr1], [arr2]]
> -> this returns []

**How to retrieve outer array and inner arrays?**


Answer: I have the solution of my own. I will go through everything once again.

**Scenario:** _I am saving data from html in mongodb through python (django).
There is a scenario where I have a single array and this array can have n
number of smaller arrays inside and the smaller arrays can again have n
numbers of smaller arrays and so on. I thought of doing it in my ajax request
but I was new to python and wanted to learn the python way._

I have attached image for reference as you can observer what I was talking
about

[![html
screenshot](http://i.stack.imgur.com/efnqf.png)](http://i.stack.imgur.com/efnqf.png)

**What I did?:** I stored all the arrays as I was required to and in python I
did this:

    
    
    from querystring_parser import parser 
    
    def index(request):
        if request.method=="POST":
            urlEncoded = parser.parse(request.POST.urlencode())
            if length < noOfActionCards:
                appendJsonKey = fullappendJsonKey[length]['']
                appendShowUi = fullappendShowUi[length]['']
                appendHintText = fullappendHintText[length]['']
                .........   
                .........
                dropDownValues = fulldropDownValues[length]
                while i < len(innerArray[length])
                # and so one iterating here...
    

and then saving it on mongodb.

