title: How can I serialize single object's fields in django(without pk and model)
body: <p>In Django, I have this model(it inherited from AbstractBaseUser):</p>
  
  <pre><code>class User(AbstractBaseUser):
      username = models.CharField(max_length=20, unique=True)
      realname = models.CharField(max_length=10)
      grade = models.CharField(max_length=10)
      studentNo = models.CharField(max_length=10)
      email = models.EmailField()
      is_active = models.BooleanField(default=True)
      is_admin = models.BooleanField(default=False)
  </code></pre>
  
  <p>I want serialize a single User object to:</p>
  
  <pre><code>{
      "studentNo": "lu", 
      "realname": "lu", 
      "email": "admin@admin.com", 
      "grade": "lu", 
      "username": "admin", 
      "is_active": true
  }
  </code></pre>
  
  <p>Is there any utility to serialize?</p>
  
  <hr>
  
  <p>I found <a href="https://docs.djangoproject.com/en/dev/topics/serialization/" rel="nofollow">the document</a> form django. Follow the cocument, It can only serialize a list and must with <code>model</code> and <code>pk</code>. It like that:</p>
  
  <pre><code>[
      {
          "fields": {
              "email": "admin@admin.com", 
              "is_active": true, 
              "studentNo": "lu", 
              "username": "admin", 
              "realname": "lu", 
              "grade": "lu"
          }, 
          "pk": 1, 
          "model": "account.user"
      }
  ]
  </code></pre>
  
  <hr>
  
  <p>I also try the build-in module <a href="https://docs.python.org/3.3/library/json.html" rel="nofollow"><code>json</code></a>, but I must get every field's key and value, save to list, and serialize it. It looks not elegant.</p>