Hello All,

I understand that feature requests are supposed to be posted to django-
developers, but I had a tentative patch, so I went ahead and opened a
ticket as well: http://code.djangoproject.com/ticket/15096

Just repeating the summary posted there: several people (see
http://stackoverflow.com/questions/4432385/django-how-to-save-m2m-data-via-post-save
signal, http://code.djangoproject.com/ticket/13950, etc) have had
trouble with / questions about model post_save signals and m2m fields.
Personally, I've got a model where the objects almost never change,
but every time one is added, I need to run a (relatively expensive)
callback function which depends on the entire collection of related
objects. Unfortunately, the model's post_save signal fires before the
m2m fields are populated, and it's wasteful to run the callback
function after every m2m_changed, since only the last change matters.

I propose adding a post_form_save signal to any ModelForm that fires
after the form's save_m2m method has been called. That will allow the
sort of m2m batch processing that I and the stackoverflow poster above
are looking for.

This is my first time submitting any sort code or working with trac,
so let me know how I can improve my postings in the future. Also, I'd
be happy try my hand at writing tests / documentation if this is a
feature that you want to implement.

- James

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en.

Reply via email to