#17186: Inverted F expression (negation)
-------------------------------------+-------------------------------------
     Reporter:  niwi                 |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  SVN
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  1
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  1                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by lrekucki):

 One more thing worth documenting, due to difference in None and NULL
 semantics:

 {{{#!python
 class A(Model):
   f = NullBooleanField()

 for m in A.objects.all():
   m.f = not m.f; m.save()  # all NULL values are now True

 # while this will leave NULL values unchanged as NOT NULL is NULL
 A.objects.update(f=not F('f'))
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17186#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to