create a new model instance version instead of update

Posted by pablo on Stack Overflow See other posts from Stack Overflow or by pablo
Published on 2010-03-13T16:52:24Z Indexed on 2010/03/13 16:55 UTC
Read the original article Hit count: 242

Filed under:
|
|

Hi,

I have a model with a version field - autocreate timestamp. When a model instance is being saved I want to create a new instance with a new timestamp instead of updating the old model instance.

Is it possible?

I thought of overriding the model save() method but I don't know how to create a new instance without creating a infinite save() loop.

Thanks

© Stack Overflow or respective owner

Related posts about django

Related posts about models