I want to render the name of the company into the database automatically whenever user submits the create form...

This is my model:

```
 class company(models.Model):
    User = models.ForeignKey(User,related_name="Company_Owner",on_delete=models.CASCADE,null=True,blank=True)
    Name = models.CharField(max_length=50,blank=False)

class group1(models.Model):
    User = models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE,null=True,blank=True)
    group_Name = models.CharField(max_length=32)
    Company = models.ForeignKey(company,on_delete=models.CASCADE,null=True,blank=True,related_name='Company_group')

```

This is what I was trying to do in my views.py:

```
class group1CreateView(LoginRequiredMixin,CreateView):
    form_class  = group1Form
    template_name = "accounting_double_entry/group1_form.html"

    def form_valid(self, form):
        form.instance.User = self.request.user
        form.instance.Company = company
        return super(group1CreateView, self).form_valid(form)

```

But got this error:

```
ValueError: Cannot assign "<class 'company.models.company'>": "group1.Company" must be a "company" instance.

```

It worked for the User but is not working for the Company..

Can anyone tell me what I am doing wrong in this???

Thank you...