title: Parsing Django QuerySet with JQuery using AJAX
body: <p>I am returning a QuerySet of 1 and my JQuery looks like this</p>
  
  <pre><code>&lt;script&gt; 
      $(document).ready(function(){
  
      $("#search_form").submit(function(event)
      {
          event.preventDefault();
  
          $.ajax({
              type: "POST",
              url: "object/search/",
              processData: false,
              dataType: "json",
              success: function(data){
                  $.each(data, function(key, value){
                      alert( key + ': ' + value );
                      });
                  }
              });
      });});
  &lt;/script&gt;
  </code></pre>
  
  <p>The alert will show up but all it returns 0: [object Object]. I would like to display the name property of the Object model that is being returned. Like using object.name. I am really stuck, your help in solving this problem is appreciated.</p>
  
  <p>The code for my view is:</p>
  
  <pre><code>if request.is_ajax():
      if request.method == 'POST':
          format = 'json'
          mimetype = 'application/json'
          o = Object.objects.filter(name__icontains="bin")
          data = serializers.serialize(format, o)
          return HttpResponse(data, mimetype)     
  </code></pre>
  
  <p>I am only returning 1 Object with this query but it is of type QuerySet.</p>
  
  <p>EDIT. Here is what data looks like when returned.</p>
  
  <pre><code>&gt;&gt;&gt; o
  [&lt;Object: Bin Ber&gt;]
  &gt;&gt;&gt; data = serializers.serialize(format, o)
  &gt;&gt;&gt; data
  '[{"pk": 1, "model": "objects.object", "fields": {"name": "Bin Ber", "roof": 3,                                               "depth": [3], "user": 1, "created_when": "2011-08-16 03:11:36", "shared": false,                                                          "projects": [1], "description": null}}]'
  </code></pre>