you simply override the save() function to do what you described:
create another instance and mark this one as deleted...

the only problem I can think of is with the instance....

for example if I do

m = Model.objects.all()[0]
m.some_field = 'new value'
m.save()

what is now in 'm' ?? the new object, the one merked for deletion? etc.
if you only need this in admin, then you shouldn't have to worry about
this, though I am not 100% sure. But if you want to use some other
code with such a model you would have to be careful about that.

On 2/18/07, Florian Apolloner <[EMAIL PROTECTED]> wrote:
>
> How can I tweak the normal save button (by hooking into the save
> method) to, instead of updating the record, add it as new one and mark
> the old one as deleted (to mark it as deleted I would like to change
> an boolean attribute...)?
>
> Thx Florian
>
>
> >
>


-- 
Honza Kr�l
E-Mail: [EMAIL PROTECTED]
ICQ#:   107471613
Phone:  +420 606 678585

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to