title: django: coercing to Unicode: need string or buffer, int found
body: <p>I'm getting this error when trying to sum up two int values:</p>
  
  <pre><code>if dups.count() &gt; 0:
          for item in dups:
              pi.quantity = pi.quantity+item.quantity
  </code></pre>
  
  <p>both pi and dups are instance of same model:</p>
  
  <pre><code>class PurchaseItem(models.Model):
      picture = models.ForeignKey(Picture, null=False)
      paperType = models.ForeignKey(paperType, null=False)
      printSize = models.ForeignKey(printSize, null=False)
      quantity = models.IntegerField(default=1, validators=[validators.MinValueValidator(1)])
      price = models.DecimalField(decimal_places=2,max_digits=8)
      dateCreated = models.DateTimeField(null=False)
      sessionKey = models.ForeignKey(Session, to_field="session_key", null=False)
      user = models.ForeignKey(User,null=True)
  
      def __unicode__(self):
          return self.id 
  </code></pre>
  
  <p>Why is int not good enough?</p>
  
  <p>if I wrap the values with str() or use their .<strong>str</strong>() representation, it doesn't do quite what I need. 1 and 1 will before 11 instead of 2.</p>