Hi,

I need to prevent to save a model overriding the ModelAdmin
save_model() method. When i try to avoid obj.save(), direct fields are
not saved, but related m2m fields are saved as well.

def save_model(self, request, obj, form, change):
        if request.user.is_superuser:
            obj.save()
        else:
            if change:
              #here i save another model but i never execute
obj.save()

How can I prevent to save m2m relations too? How I can achieve the
original object not be changed?

There is an old thread with the same issue:
http://groups.google.com/group/django-users/browse_thread/thread/1d6c03b2464a486/07b31c5c0acb6302?lnk=gst&q=save_model+%2B+m2m#07b31c5c0acb6302
Any solution?
Thanks,
Mario.

-- 
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