title: python writing csv Django for loop
body: <p>I'm a bit stuck with writing a csv file using the python csv library. I'm using Django to get the information into objects out of a database.</p>
  
  <p>What I have now, works but is not yet complete:</p>
  
  <pre><code>writer.writerow([Itag.Gen_ID if Itag else '',
       Itag.Solyc if Itag else '',
       Itag.GO_number if Itag else '',
       Itag.GO_def if Itag else '',
       Itag.Itag_description if Itag else '',
       Itag.IPR_Number if Itag else '',
       Itag.IPR_Description if Itag else '',
       Itag.Trivial_name if Itag else '',
       Loci.Locus_symbol if Loci else '',
       Loci.Locus_name if Loci else '',])
  </code></pre>
  
  <p>This writes away the object information into a CSV file if there is a object present.
  Now in the next part I Have a Object called <code>Blast</code>,
  <code>Blast</code> Has a couple of properties:
  <code>Blast.name, Blast.hit, Blast.score</code>
  The object <code>Itag</code> has a one on one relation with <code>Loci</code> that's why it all fits nicely in a row.</p>
  
  <p>Now the <code>Blast</code> object has a many on one relation with <code>Itag</code>and <code>Loci</code>
  so 5 <code>Blast</code> hits can have a relation with 1 <code>Itag and Loci</code> Hit.</p>
  
  <p>Now how do I write all the 5 <code>Blast</code> object properties to the same row in the CSV file?</p>