Opened 17 years ago
Closed 17 years ago
#7162 closed (invalid)
created keyword not sent to signal pre_save
Reported by: | italomaia | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | signals, keyword | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
kwargs does not have a created keyword, EVER. This seems to be a error as one could want
to change a object before it is create.
Example:
def pre_save(sender, instance, signal, *args, kwargs):
if 'created' in kwargs:
if kwargscreated:
print "some stuff"
dispatcher.connect(pre_save, signal=signals.pre_save, sender=Sender)
print "some stuff" is never called.
Note:
See TracTickets
for help on using tickets.
If you want to do something before the object saves, use the
pre_save
signal. If you want to do something before it has been completely instantiated, use thepre_init
signal. Similarly,post_save
andpost_init
are available.