title: Django JSON serializable error
body: <p>With the following code below, There is an error saying </p>
  
  <pre><code>      File "/home/user/web_pro/info/views.py", line 184, in headerview,
        raise TypeError("%r is not JSON serializable" % (o,))
        TypeError: &lt;lastname: jerry&gt; is not JSON serializable
  </code></pre>
  
  <p>In the models code</p>
  
  <pre><code>  header(models.Model):
     firstname = models.ForeignKey(Firstname)
     lastname = models.ForeignKey(Lastname)
  </code></pre>
  
  <p>In the views code</p>
  
  <pre><code>  headerview(request):
         header = header.objects.filter(created_by=my_id).order_by(order_by)[offset:limit]
  
  
        l_array = []
        l_array_obj = []
        for obj in header:
  
             l_array_obj = [obj.title, obj.lastname ,obj.firstname ]
             l_array.append(l_array_obj)
        dictionary_l.update({'Data': l_array}) ; 
        return HttpResponse(simplejson.dumps(dictionary_l), mimetype='application/javascript')
  </code></pre>
  
  <p>what is this  error and how to resolve this?</p>
  
  <p>thanks..</p>