django - Make a copy of a model instance -


i have 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 shown own contract through inline.

i need able modify contract without removing contract i'm modifying, record of contracts person has had. mean, i'll have make copy of contract want modify , make changes in copy @ end i'll have both contracts (the previous 1 , modified version of one).

i guess need link or button next every row of inline in order go contract admin page , modify copy of particular contract.

so far, i've seen some ways make copy don't know how use them need.

does know how go it?


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -