Code

Opened 3 years ago

Closed 3 years ago

#15096 closed (wontfix)

Add post_form_save signal

Reported by: jamesdabbs Owned by: jamesdabbs
Component: Uncategorized Version: master
Severity: Keywords: signals
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: yes
Easy pickings: UI/UX:

Description

Several people (see stackoverflow, #13950, django-developers) 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 this gentleman) are looking for.

Attachments (1)

post_form_save.diff (1.3 KB) - added by jamesdabbs 3 years ago.

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by jamesdabbs

comment:1 Changed 3 years ago by jamesdabbs

  • Has patch set
  • Needs documentation set
  • Needs tests set
  • Owner changed from nobody to jamesdabbs
  • Patch needs improvement set
  • Status changed from new to assigned

comment:2 Changed 3 years ago by russellm

  • Resolution set to wontfix
  • Status changed from assigned to closed

discussion on Django-dev

Marking wontfix.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.