Opened 6 years ago

Closed 6 years ago

#12184 closed (wontfix)

Post/Pre-Save signal on queryset update

Reported by: Bernhard <bernhardv@…> Owned by: nobody
Component: Database layer (models, ORM) Version: 1.1
Severity: Keywords: queryset, signals, update
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Django is sending the pre/post_delete signals if you are using the queryset.delete() method, but shouldn't it then also send pre/post_save on queryset.update()?

Change History (2)

comment:1 Changed 6 years ago by Bernhard <bernhardv@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 6 years ago by russellm

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

I'm not sure it's practical to do so. We're able to send a signal to every object in a delete because we are iterating over every object. However, we don't (currently) iterate over every object in an update - it's an atomic SQL UPDATE call. In order to send a signal on update, we would need to also issue a SELECT call, and iterate over the result of that select twice. This would essentially eliminate any processing benefit from making an update query.

Marking wontfix. Please raise on django-dev if you disagree with my reasoning.

Note: See TracTickets for help on using tickets.
Back to Top