Code

Opened 6 years ago

Closed 6 years ago

#7162 closed (invalid)

created keyword not sent to signal pre_save

Reported by: italomaia Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords: signals, keyword
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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.

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by ubernostrum

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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.

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.