Code

Opened 4 years ago

Closed 4 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()?

Attachments (0)

Change History (2)

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

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

comment:2 Changed 4 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.

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.