title: Can't figure out how to append JSON into a single parent object
body: <p>I'm having an issue which I can't figure out the solution of.  I'm trying to build a JSON object.  I'm working with some VMware API and I'm building a JSON object for usernames and nesting VM information inside.  I'm having trouble building the nested objects.  See below and I'll explain further.  Note, annotation is used as a tag to identify the owner of the virtual machine.</p>
  
  <pre><code>owner_logged_in = "johndoe"
  service_instance = connect.SmartConnectNoSSL(host='10.0.0.202', user='', pwd='')
  atexit.register(connect.Disconnect, service_instance)
  content = service_instance.RetrieveContent()
  container = content.rootFolder  # starting point to look into
  viewType = [vim.VirtualMachine]  # object types to look for
  recursive = True  # whether we should look into it recursively
  containerView = content.viewManager.CreateContainerView(container, viewType, recursive)
  children = containerView.view
  
  virtual_machines = []
  vm_username = {}
  vm_container = {}
  for child in children:
      summary = child.summary
      annotation = summary.config.annotation
      if owner_logged_in == annotation:
          children = []
          children.append({'ip': summary.guest.ipAddress,'power': summary.runtime.powerState})
          vm_container['name'] = summary.config.name
          vm_username[owner_logged_in] = vm_container
          vm_container['properties'] = children
          jsonvalues = json.dumps(vm_username)
          #debug#
          print(jsonvalues)
          #debug#
  </code></pre>
  
  <p>The returned results are as follows:</p>
  
  <pre><code> {"johndoe": {"name": "centos01", "properties": [{"ip": "10.0.0.201", "power": "poweredOn"}]}}
   {"johndoe": {"name": "dc01", "properties": [{"ip": "10.0.0.200", "power": "poweredOn"}]}}
  </code></pre>
  
  <p>I need to somehow combine these two into 1 object that I can store in a value which then I'm using a DJANGO web app iterate through the value to build a table using some javascript (tabullar.js).  I can handle that part but what I'm struggling with is coming up with a way to make 1 object.  A user might have more than one virtual machines and I need the properties of each but make the 'johndoe' be the parent.</p>
  
  <p>Essentially I need it formatted to look like this to properly convert it to a table using the tabular.js.  </p>
  
  <pre><code>{  
    "johndoe":[  
       {  
          "name":"centos01",
          "properties":[  
             {  
                "ip":"10.0.0.201",
                "power":"poweredOn"
             }
          ]
       },
       {  
          "name":"dc01",
          "properties":[  
             {  
                "ip":"10.0.0.200",
                "power":"poweredOn"
             }
          ]
       }
    ]
  }
  </code></pre>
  
  <p>Any help would greatly be appreciated!</p>