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.

Change History (1)

comment:1 by James Bennett, 17 years ago

Resolution: invalid
Status: newclosed

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 the pre_init signal. Similarly, post_save and post_init are available.

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