title: python autofill html data- expecting number but data type is string
body: <p>I am trying to autofill html form data using python.  If I run the code without the autofill data, the webpage loads just fine.  But when I add the autofill data, I get: </p>
  
  <pre><code>TypeError: %d format: a number is required, not unicode
  </code></pre>
  
  <p>This is the code for the autofill data:</p>
  
  <pre><code>class EditCarHandler(webapp2.RequestHandler):
  template_variables = {}
  
  def get(self):
  
      template = JINJA_ENVIRONMENT.get_template('/edit_cars.html')
      self.response.write(template.render(self.template_variables))
  
      carID = self.request.get('id')
      carData = Car.get_by_id(int(carID))
  
      colorArray = ['', '', '', '', '', '', '', '', '', '']
      for i in carData.color:
          if i == "red":
              colorArray[0] = " checked"
          elif i == "orange":
              colorArray[1] = " checked"
          elif i == "yellow":
              colorArray[2] = " checked"
          elif i == "green":
              colorArray[3] = " checked"
          elif i == "blue":
              colorArray[4] = " checked"
          elif i == "purple":
              colorArray[5] = " checked"
          elif i == "black":
              colorArray[6] = " checked"
          elif i == "white":
              colorArray[7] = " checked"
          elif i == "gray":
              colorArray[8] = " checked"
          elif i == "other":
              colorArray[9] = " checked"
  
      conditionArray = ['', '', '']
      if carData.condition == "new":
          conditionArray[0] = " checked"
      elif carData.condition == "used":
          conditionArray[1] = " checked"
      elif carData.condition == "damaged":
          conditionArray[2] = " checked"
  
  
      self.response.write("""
      &lt;main&gt;
          &lt;form action="/editCarsForm" method="get"&gt;
              &lt;input type="hidden" name="id" value="%s"&gt;
              &lt;fieldset&gt;
                  &lt;legend&gt;Make:&lt;/legend&gt;
                  &lt;input type="text" name="car-make" value="%s"&gt;
                  &lt;legend&gt;Model:&lt;/legend&gt;
                  &lt;input type="text" name="car-model" value="%s"&gt;
              &lt;/fieldset&gt;
              &lt;fieldset&gt;
                  &lt;legend&gt;Year:&lt;/legend&gt;
                  &lt;input type="number" name="car-year" min="1960" max="2016" value="%s"&gt;
              &lt;/fieldset&gt;
              &lt;fieldset&gt;
                  &lt;legend&gt;Color:&lt;legend&gt;
                  &lt;input type="checkbox" name="car-color" value="red"%s&gt;Red
                  &lt;input type="checkbox" name="car-color" value="orange"%s&gt;Orange
                  &lt;input type="checkbox" name="car-color" value="yellow"%s&gt;Yellow
                  &lt;input type="checkbox" name="car-color" value="green"%s&gt;Green
                  &lt;input type="checkbox" name="car-color" value="blue"%s&gt;Blue
                  &lt;input type="checkbox" name="car-color" value="purple"%s&gt;Purple
                  &lt;input type="checkbox" name="car-color" value="black"%s&gt;Black
                  &lt;input type="checkbox" name="car-color" value="white"%s&gt;White
                  &lt;input type="checkbox" name="car-color" value="gray"%s&gt;Gray
                  &lt;input type="checkbox" name="car-color" value="other"%s&gt;Other
              &lt;/fieldset&gt;
              &lt;fieldset&gt;
                  &lt;legend&gt;Condition:&lt;/legend&gt;
                  &lt;input type="radio" name="car-condition" value="new"%s&gt;New
                  &lt;input type="radio" name="car-condition" value="used"%s&gt;Used
                  &lt;input type="radio" name="car-condition" value="damaged"%s&gt;Damaged
              &lt;/fieldset&gt;
              &lt;fieldset&gt;
                  &lt;legend&gt;Today's Date:&lt;/legend&gt;
                  &lt;input type="date" name="car-date" min="2016-01-01" max="2017-01-01" value="%s"&gt;
              &lt;/fieldset&gt;
              &lt;br&gt;
              &lt;input type="submit" value="Update Car"&gt;
              &lt;input type="hidden" name="action" value="edit_car"&gt;
          &lt;/form&gt;
          &lt;br&gt;
          &lt;form action="/viewCars" method="get"&gt;
              &lt;button&gt;View Cars&lt;/button&gt;
          &lt;/form&gt;
      &lt;/main&gt;
      """ % (carID, carData.make, carData.model, carData.year, 
      colorArray[0], colorArray[1], colorArray[2], colorArray[3], colorArray[4], colorArray[5], colorArray[6], colorArray[7], colorArray[8], colorArray[9],
      conditionArray[0], conditionArray[1], conditionArray[2], 
      carData.date))
  </code></pre>
  
  <p>Any help is appreciated, Thanks</p>