title: How to create multiple objects with different values at a time in django?
body: <p>I need to create two models from a single template. Creating Product model is fine. The Product model has the ManyToOne relation with ProductVariant. But I got problem while creating ProductVariant model.
  <code>request.POST.getlist('names')</code> this gives me the result like this <code>['name1','name2</code>] and the same goes for all.
  I want to create ProductVariant object with each values. How can I do this ?  Also I think there is a problem while stroing a <code>HStoreField</code>. <code>request.POST.getlist('attributes')</code> gives the value like this <code>['a:b','x:z']</code> so I converted it into dictionary(but not sure it works).</p>
  <p>UPDATE:</p>
  <p>What I want is
  <code>attributes</code>, <code>names</code> ... all will have the same number of items in the list.
  For example if the name is <code>['a','b','c']</code> then weight will also have 3 values in the list <code>[12,15,23]</code> like this.
  I want to create <code>ProductVariant</code> object 3 times since every list will have 3 items in the list. The first object will have field values from the list first item which is <code>name=a,weight=12..</code> and for the second object values will be <code>name=b, weight=15</code> like this.</p>
  <p>How will it be possible? Or I should change the logic ? Any suggestions ?
  models</p>
  <pre><code>class ProductVariant(models.Model):
      name = models.CharField(max_length=255, blank=False, null=False)
      product = models.ForeignKey(Product, on_delete=models.CASCADE)
      attributes = HStoreField()
      price = models.FloatField(blank=False, null=False, default=0.0) 
  </code></pre>
  <p>views</p>
  <pre><code>        product = product_form.save()           
          attributes = request.POST.getlist('attributes')
          names = request.POST.getlist('name')
          up = request.POST.getlist('price')
          weight = request.POST.getlist('weight')
          print(names, 'names')
          # converting attributes into the dictionary for the HStore field
          for attribute in attributes:
              attributes_dict = {}
              key, value = attribute.split(':')
              attributes_dict[key] = value
          
         ProductVariant.objects.create(name=name,...) # for each value I want to create this.
  </code></pre>