Fixed #31396 -- Added binary XOR operator to F expressions.

This commit is contained in:
Hannes Ljungberg 2020-03-20 23:08:32 +01:00 committed by Mariusz Felisiak
parent 39e1c88de6
commit f3da09df0f
8 changed files with 44 additions and 4 deletions

View file

@ -656,10 +656,18 @@ that were modified more than 3 days after they were published::
>>> Entry.objects.filter(mod_date__gt=F('pub_date') + timedelta(days=3))
The ``F()`` objects support bitwise operations by ``.bitand()``, ``.bitor()``,
``.bitrightshift()``, and ``.bitleftshift()``. For example::
``.bitxor()``, ``.bitrightshift()``, and ``.bitleftshift()``. For example::
>>> F('somefield').bitand(16)
.. admonition:: Oracle
Oracle doesn't support bitwise XOR operation.
.. versionchanged:: 3.1
Support for ``.bitxor()`` was added.
The ``pk`` lookup shortcut
--------------------------