title: Django MongoDB QuerySet result Into JSON
body: <p>I have these models:</p>
  
  <pre><code>class Projects(models.Model):
      projectName =models.CharField(max_length = 100,unique=True,db_index=True)
      projectManager = EmbeddedModelField('Users')
  
  class Users(models.Model):
      name = models.CharField(max_length = 100,unique=True)
      designation = models.CharField(max_length =100 )
  </code></pre>
  
  <p>I need to return JSON from my view for all Projects objects,I tried json.dumps(Projects.objects.all()) but it did not worked,how do i accomplished it??</p>
  
  <p><strong>EDIT:</strong>
  I used json.dumps(Projects.objects.all().values()) and got this:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;console&gt;", line 1, in &lt;module&gt;
    File "D:\Python27\lib\json\__init__.py", line 238, in dumps
      **kw).encode(obj)
    File "D:\Python27\lib\json\encoder.py", line 203, in encode
      chunks = list(chunks)
    File "D:\Python27\lib\json\encoder.py", line 436, in _iterencode
      o = _default(o)
    File "D:\Python27\lib\json\encoder.py", line 178, in default
      raise TypeError(repr(o) + " is not JSON serializable")
  TypeError: [{'projectName': u'HELLO', 'projectManager': {u'id': u'4eb3b792b990a24e49f6bb26', u'name': u'anshul', u'designation': u'programmer', u'teams': []}, '
  id': u'4eb3b7d0e814520db4000000'}] is not JSON serializable  
  </code></pre>
  
  <p>Now i am getting the result what i want but why is this giving me error as well.</p>