title: Django coercing to Unicode: need string or buffer, datetime.date found
body: <p>I have a model:</p>
  
  <pre><code>class MyModel(models.Model):
      id = models.IntegerField(primary_key=True)
      recorded_on = models.DateField()
      precipitation = models.FloatField(null=True, blank=True)
  </code></pre>
  
  <p>in my views I have a query thus:</p>
  
  <pre><code>import datetime
  
  def my_view(request):
      ...
      format = '%Y-%m-%d' 
      sd = datetime.datetime.strptime(startdate, format)
      ed = datetime.datetime.strptime(enddate, format)
      queryset = MyModel.objects.filter((recorded_on__range = (sd, ed)))
      ...
  </code></pre>
  
  <p>But whenever I try and do anything with the queryset (e.g. json dump, display in template), I get the following error:</p>
  
  <pre><code>    coercing to Unicode: need string or buffer, datetime.date found
  </code></pre>
  
  <p>I know there must be an easy way to deal with this, but I have not yet found it.</p>
  
  <p>Any help would be much appreciated.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>An example of data: </p>
  
  <pre><code>+----+-------------+---------------+
  | id | recorded_on | precipitation |
  +----+-------------+---------------+
  | 24 | 1987-07-02  |          20.7 |
  | 33 | 1987-07-11  |           0.4 |
  +----+-------------+---------------+
  </code></pre>