Ticket #15096: post_form_save.diff
File post_form_save.diff, 1.3 KB (added by , 14 years ago) |
---|
-
django/db/models/signals.py
14 14 post_syncdb = Signal(providing_args=["class", "app", "created_models", "verbosity", "interactive"]) 15 15 16 16 m2m_changed = Signal(providing_args=["action", "instance", "reverse", "model", "pk_set", "using"]) 17 18 post_form_save = Signal(providing_args=["instance"]) -
django/forms/models.py
67 67 If construct=False, assume ``instance`` has already been constructed and 68 68 just needs to be saved. 69 69 """ 70 from django.db.models import signals 70 71 if construct: 71 72 instance = construct_instance(form, instance, fields, exclude) 72 73 opts = instance._meta … … 82 83 continue 83 84 if f.name in cleaned_data: 84 85 f.save_form_data(instance, cleaned_data[f.name]) 86 # Signal that the save is complete 87 signals.post_form_save.send(sender=form.__class__, instance=instance) 85 88 if commit: 86 89 # If we are committing, save the instance and the m2m data immediately. 87 90 instance.save()