title: Saving model instance using pre_save signal
body: <p>These are my models:</p>
  
  <pre><code>class Stockdata(models.Model):
      user        = models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE,null=True,blank=True,related_name='user_stock')
      company     = models.ForeignKey(Company,on_delete=models.CASCADE,null=True,blank=True)
      stock_name  = models.CharField(max_length=32)
  
  class Stock_journal(models.Model):
      user                = models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE,null=True,blank=True,related_name='user_closing')
      company             = models.ForeignKey(Company,on_delete=models.CASCADE,null=True,blank=True)
      stockitem           = models.OneToOneField(Stockdata,on_delete=models.CASCADE,null=True,blank=True,related_name='closingstock')
      closing_stock       = models.DecimalField(max_digits=10,decimal_places=2,null=True)
  </code></pre>
  
  <p>This is my signal:</p>
  
  <pre><code>@receiver(post_save, sender=Stockdata)
  def create_default_stock_ledger(sender, instance, created, **kwargs):
      if created:
          Stock_journal.objects.create(user=instance.User,company=instance.Company,stockitem=instance)
  </code></pre>
  
  <p>I want to pass a pre_save signal of the same as I have done in my post_save signal i.e. I want to perform a pre_save signal function instead of a post_save signal..</p>
  
  <p>When I try to do using pre_save signal I get the following error:</p>
  
  <pre><code>save() prohibited to prevent data loss due to unsaved related object 'stockitem'.
  </code></pre>
  
  <p>Any idea how to do this?</p>
  
  <p>Thank you</p>