I was looking at the documentation here, about pre_save
and post_save
in django. The documentation really does not provide much substance, so what does pre_save
and post_save
do?
Asked
Active
Viewed 216 times
0

Games Brainiac
- 80,178
- 33
- 141
- 199
-
[Take a look at this answer](http://stackoverflow.com/a/17658156/1628832) Hopefully it should help – karthikr Jul 16 '13 at 15:05
1 Answers
1
You probably skipped the introduction to signals in the docs:
Django includes a “signal dispatcher” which helps allow decoupled applications get notified when actions occur elsewhere in the framework. In a nutshell, signals allow certain senders to notify a set of receivers that some action has taken place.
Let's say you want to create a slug you have basically two options:
-
This is what I was confused about since I always override the `save` method, so I've never needed to use `pre_save` or `post_save`. – Games Brainiac Jul 16 '13 at 06:41
-
1Overriding ```save()``` makes sense in that case. But as soon as your application grows larger and/or you need to take actions in regard to events of an pluggable app you use, signals become really useful. – arie Jul 16 '13 at 06:46