Django Model to Associative Array
<p>Is there any way to convert a django models to an associative array using a loop for HttpResponse.</p>

<pre><code>class Guest(models.Model):
    fname = models.CharField(max_length=200)
    mname = models.CharField(max_length=200, default="", blank=True, null=True)
    lname = models.CharField(max_length=200)
    gender = models.CharField(max_length=20, choices=gender_choices, default="")
    birth_date = models.DateField()
    address = models.TextField()
    phone = models.CharField(max_length=20)
    mobile = models.CharField(max_length=20, default="", blank=True, null=True)
    fax = models.CharField(max_length=20, default="", blank=True, null=True)
    email = models.CharField(max_length=200)
    id_type = models.CharField(max_length=200, default="", blank=True, null=True)
    id_number = models.CharField(max_length=200, default="", blank=True, null=True)
</code></pre>

<p>my expected result was like this</p>

<pre><code>{ 
    "fname" : "sample",
    "mname" : "sample",
    "lname" : "sample",
    ...
}
</code></pre>

<pre><code>guest = Guest.objects.get(pk=1)
print guest.__dict__
</code></pre>

python django