title: Switching value of boolean field with update method in Django
body: <p>I have a model instance which has a boolean field on it. What I want to achieve is to switch the value from True to False or vice versa.</p>
  
  <p>Surely, I can just write:</p>
  
  <pre><code>inst = Model.objects.get(id=1)
  inst.boolean_field = not inst.boolean_field
  inst.save()
  </code></pre>
  
  <p>But there are 2 queries: one for fetching and another one for updating.</p>
  
  <p>I'd like just to switch the values, but the following does not seem to work:</p>
  
  <pre><code>Model.objects.filter(id=1).update(boolean_field=not F("boolean_field"))
  </code></pre>
  
  <p>I'm pretty sure that I'm doing something wrong or it's just not possible.</p>