title: Django - coercing to Unicode
body: <p>I am having a unicode problem and, as everytime I have something related I'm completely lost..</p>
  
  <p>One of my Django template renders a TypeError :</p>
  
  <pre><code>Exception Value:    
  
  coercing to Unicode: need string or buffer, long found
  </code></pre>
  
  <p>The line giving trouble is just a string ( which I want to use in a mysql query) :</p>
  
  <pre><code>query = unicode('''(SELECT asset_name, asset_description, asset_id, etat_id, etat_name FROM Asset LEFT OUTER JOIN Etat ON etat_id_asset=asset_id WHERE asset_id_proj='''+proj+''' AND asset_id_type='''+t.type_id+''' ORDER BY asset_name, asset_description) UNION (SELECT asset_name, asset_description, asset_id, 'NULL', 'NULL' FROM Asset WHERE asset_id_proj='''+proj+''' AND asset_id_type='''+t.type_id+''' AND asset_id IN (SELECT etat_id_asset FROM Etat)); ''')
  </code></pre>
  
  <p>What can be wrong here ?</p>