Django Two foreign key
I have two models: **UserProfile** (extended from user) and **Cv**. I created another model that have two foreign key that come from theses models. 

    class cv(models.Model):
        user = models.ForeignKey(User, unique=True)
        cv_d= models.TextField(max_length=1100)
        ...
    class cvv(models.Model):
        user = models.ForeignKey(User)    
        cv= models.ForeignKey(cv)    
        date = models.DateTimeField(auto_now=True)

In my **view**, I am trying to insert value on cvv:

    ...
    obj = cv.objects.get(pk=id,active=True)
    add=cvv(user=request.user, cv=obj)    
    add.save()

But, I am getting the following error:
**(1452, 'Cannot add or update a child row: a foreign key constraint fails** 

How can I insert theses 2 foreign key on my model?

Django Two foreign key
===

I have two models: **UserProfile** (extended from user) and **Cv**. I created another model that have two foreign key that come from theses models. 

    class cv(models.Model):
        user = models.ForeignKey(User, unique=True)
        cv_d= models.TextField(max_length=1100)
        ...
    class cvv(models.Model):
        user = models.ForeignKey(User)    
        cv= models.ForeignKey(cv)    
        date = models.DateTimeField(auto_now=True)

In my **view**, I am trying to insert value on cvv:

    ...
    obj = cv.objects.get(pk=id,active=True)
    add=cvv(user=request.user, cv=obj)    
    add.save()

But, I am getting the following error:
**(1452, 'Cannot add or update a child row: a foreign key constraint fails** 

How can I insert theses 2 foreign key on my model?
