title: How to build a django query to save mixing int and str from a json var?
body: <p>I have a JSON var like:</p>
  
  <pre><code>myjson = [{"name":"bla", "value":111}, {"name":"ble", "value":222}, {"name":"bli", "value":333}, {"name":"blo", "value":444}]
  </code></pre>
  
  <p>my Django model is:</p>
  
  <pre><code>class myTable(models.Model):
      name = models.TextField(max_length=2000)
      bla = models.IntegerField(default=0)
      ble = models.IntegerField(default=0)
      bli = models.IntegerField(default=0)
      blo = models.IntegerField(default=0)
      def __unicode__(self):
          return '%s, %s, %s, %s' % (self.name, self.bla, self.ble, self.bli, self.blo)
  </code></pre>
  
  <p>I want to save this row (from my views.py):</p>
  
  <pre><code>from myproject.models import myTable
  n = "lalala"
  query = myTable(name="lalala", bla=111, ble=222, bli=333, blo=444)
  query.save()
  </code></pre>
  
  <p>I don't know how to build the query iterating the JSON.</p>
  
  <p>If I build an string:</p>
  
  <pre><code>#&gt;&gt;&gt; q="lalala"
  #&gt;&gt;&gt; myzonesstring = 'name="'+q+'", '
  #&gt;&gt;&gt; for m in myjson: 
  #...     myzonesstring += str(m["name"])+'='+str(m["value"])+', ' ... 
  #&gt;&gt;&gt; myzonesstring 'name="lalala", bla=111, ble=222, bli=333, blo=444, '
  #&gt;&gt;&gt; myzonesstring[:-2] 'name="lalala", bla=111, ble=222, bli=333, blo=444'
  #&gt;&gt;&gt; query = myTable(myzonesstring[:-2])
  #&gt;&gt;&gt; query.save() [. python . ValueError: invalid literal for int() with base 10: 'name="lalala", bla=111, ble=222, bli=333, blo=444'
  </code></pre>