New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #21461, Add pre_update and post_update signals #2619

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@bendavis78
Contributor

bendavis78 commented Apr 30, 2014

Assuming this would be targeted for 1.8, since it missed the feature freeze.

@bendavis78

This comment has been minimized.

Contributor

bendavis78 commented May 16, 2014

You can follow the progress of the official ticket here: https://code.djangoproject.com/ticket/21461 .

I wouldn't expect much activity on this one right now, with 1.7 imminent and this being a feature addition. It'd be nice to get some feedback regarding design decision though.

@@ -571,12 +571,24 @@ def update(self, **kwargs):
"""
assert self.query.can_filter(), \
"Cannot update a query once a slice has been taken."
meta = self.model._meta

This comment has been minimized.

@timgraham

timgraham Jun 5, 2014

Member

this is usually called opts = self.model._meta

responses = signals.pre_update.send(
sender=self.model, update_fields=kwargs,
queryset=self._clone(), using=self.db)
for rcvr, response in responses:

This comment has been minimized.

@timgraham

timgraham Jun 5, 2014

Member

rcvr -> receiver (no need to obfuscate it)

Sent at the beginning of a queryset's
:meth:`~django.db.models.query.QuerySet.update` method. The connected signal may
optionlly return a dict of extra data that will later be sent to the

This comment has been minimized.

@timgraham

timgraham Jun 5, 2014

Member

optionally
dict -> dictionary

the queryset's :meth:`~django.db.models.query.QuerySet.update` method.
``queryset``
A clone of the queryset on which ``update()`` is being called.

This comment has been minimized.

@timgraham

timgraham Jun 5, 2014

Member

clone -> copy? (that term doesn't seem to be used elsewhere in the docs which could cause confusion)

@timgraham

This comment has been minimized.

@timgraham

This comment has been minimized.

Member

timgraham commented Jun 25, 2014

Closing this per ticket.

@timgraham timgraham closed this Jun 25, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment