title: How many rows were deleted?
body: <p>Is it possible to check how many rows were deleted by a query?</p>
  
  <pre><code>queryset = MyModel.object.filter(foo=bar)
  queryset.delete()
  deleted = ...
  </code></pre>
  
  <p>Or should I use transactions for that?</p>
  
  <pre><code>@transaction.commit_on_success
  def delete_some_rows():
      queryset = MyModel.object.filter(foo=bar)
      deleted = queryset.count()
      queryset.delete()
  </code></pre>
  
  <p>PHP + MySQL example:</p>
  
  <pre><code>mysql_query('DELETE FROM mytable WHERE id &lt; 10');
  printf("Records deleted: %d\n", mysql_affected_rows());
  </code></pre>