Python dictionary isn't updating
<pre><code>def mergeDict(object):
    dict1 = {}
    for i in range(len(object)):
        dict1.update({'id': object[i].id, 'name': object[i].name, 'age': object[i].age, 'location': object[i].location})
        return dict1
merged_dict = mergeDict(details_sorted)
</code></pre>

<p>But this doesn't work.</p>

<p>I want to get something like this:</p>

<pre><code>{1: {'id': 1, 'name': 'John', 'age': '25'; 'location': 'somewhere'},
 2: {'id': 2, 'name': ......}}
</code></pre>
