title: Prevent signal sending for specific save() calls
body: <p>I'm performing some persistence actions with the model's object when receiving a <code>post_save</code> signal, which includes a call to <code>save()</code>. Obviously the <code>save()</code> call sends a <code>post_save</code> signal again and I'm landing in a signal recursion.</p>
  
  <p>Is there a way to prevent Django to send a <code>post_save</code> signal on a specific <code>save()</code> call? Or can I detect in my signal callback if a call was "looped"?</p>
  
  <h2>That didn't work</h2>
  
  <p>I tried to modify the model's object by adding a attribute, but it seems like <code>django.db.models.base.Model.save_base</code> passes a "sanitized" object to the signal callback, which does not contain that attribute anymore:</p>
  
  <pre><code>def callback(sender, **kwargs):
      instance = kwargs['instance']
      if not hasattr(instance, 'no_signal'):
          # (...) Perform actions
          instance.no_signal = True
          instance.save()
  post_save.connect(callback, dispatch_uid='post_save_callback')
  </code></pre>
  
  <h2>Background</h2>
  
  <p>The complete situation is a bite more complex, than just receiving the signal, modifying the object and persisting it. In fact I have two identical Django instances (on different servers) which exchange created or modified objects (via ØMQ) and persist it in their own database. I don't want to use any kind of DB synchronization, since the application needs to be deployable easily and should even work with sqlite.</p>
  
  <p>Since this should work for all models, regardless if they were modified/created via a view or the admin app, I'd prefer finding a way to use the <code>post_save</code> signal rather than introducing an own one, which needs to be triggered in various points in the project (including the <code>User</code> model).</p>