title: Django, python 2.7 : insert multiple records into two related tables
body: <p>New to Django orm and i need guidance:</p>
  
  <p>i want to insert 5 records in a table say 'Table1' with PK 'table1Primary'</p>
  
  <p>then insert same number of records into another table 'Table2' with table 1 PK 'table1Primary' as foreign key</p>
  
  <p>example:Table1 primary key</p>
  
  <ol>
  <li>pk1 </li>
  <li>pk2 </li>
  <li>pk3  </li>
  <li>pk4</li>
  </ol>
  
  <p>Table 2 foreign keys</p>
  
  <ol>
  <li>pk1</li>
  <li>pk2</li>
  <li>pk3</li>
  <li>pk4</li>
  </ol>
  
  <p>[i would rather use bulk_create or any other optimized way rather than writing separate insert statements]</p>
  
  <p>code that doesn't work, i am assuming because of this line<br>
   eft_fulfillment_uid=ef , i end up with 5*5 inserts in second </p>
  
  <pre><code> for i in range(5):
      ef = Fulfillment.objects.create(
          fullfillment_uid=generateid(),
          ...
          ...
      )
      ef.save()
  
  for i in range(5):
      por = OutReq.objects.create(
          out_req_uid=random.randint(500, 1000000000),
          fulfillment_uid=ef,
          ...
          ...
      )
      por.save()
  </code></pre>