title: I have two models and they are connected through ForiegnKey in my Django Project
body: <p>#Models.py  </p>
  
  <pre><code>     class Appname(models.Model):
  
         name=models.CharField(max_length=150,blank=False,null=False)
  
         def __str__(self):
             return self.name
  class placement(models.Model):
      user=models.ForeignKey(User,related_name='placeid', null=True, default=None,on_delete=models.CASCADE) 
      name=models.ForeignKey(Appname,related_name='appname',null=True,default=None,on_delete=models.CASCADE,editable=False)
      ad_space=models.CharField(max_length=150,blank=False,null=False)
      PID_TYPE = (
          ('FN','FORMAT_NATIVE'),
          ('FNB','FORMAT_NATIVE_BANNER'),
          ('FI','FORMAT_INTERSTITIAL'),
          ('FB','FORMAT_BANNER'),
          ('FMR','FORMAT_MEDIUM,RECT'),
          ('FRV','FORMAT_REWARDED_VIDEO'),
          )
  
         format = models.CharField(max_length=3,choices = PID_TYPE,default = 'FN',blank=False, null=False)
         pid=models.CharField( max_length=50,default='',blank=False, null=False)
         cpm=models.IntegerField(default=0,blank=False, null=False)
         ADS_TYPE=(
         ('FB','FACEBOOK'),
         ('G','GOOGLE'),
         )         source=models.CharField(max_length=2,choices=ADS_TYPE,default='FB',blank=False, null=False)
        comments=models.TextField(default='',blank=False, null=False)
        objects=models.Manager()
  
  
        def __str__(self):
           return self.ad_space
  
        def get_absolute_url(self):
           return reverse("dashapp:view")
  </code></pre>
  
  <h1>Here is the Ques.</h1>
  
  <p>I  save my first model through form using generic view now i have used ForeignKey in my 2nd model . I want  that when i fill my second Form the name variable gets autofill with the first model value . can i do that??</p>