I have the following code:
class Person(models.Model):
name = models.CharField(max_length=32, verbose_name=_(u"Name"))
surname = models.CharField(max_length=32, verbose_name=_(u"Surname"))
address = models.CharField(max_length=32, verbose_name=_(u"Address"))
class Contract(models.Model):
person = models.ForeignKey(Person) #person hired
project = models.ForeignKey(Project, blank = True, null = True)
starting_date = models.DateField(blank = True, null = True)
ending_date = models.DateField(blank = True, null = True)
Each person is shown with its own contract through an Inline.
I need to be able to modify a contract but without removing the contract I'm modifying, for the record of all contracts that a person has had. I mean, I'll have to make a copy of the contract I want to modify and then make the changes in that copy so at the end I'll have both contracts (the previous one and the modified version of that one).
I guess what I need is something like a link or button next to every row of the inline in order to go to the Contract admin page and modify a copy of that particular contract.
So far, I've seen some ways to make a copy but I don't know how to use them to do what I need.
Does anyone know how to go about it?