mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #25912 -- Added binary left/right shift operators to F expressions.
Thanks Mariusz Felisiak for review and MySQL advice.
This commit is contained in:
@@ -652,11 +652,15 @@ that were modified more than 3 days after they were published::
|
||||
>>> from datetime import timedelta
|
||||
>>> Entry.objects.filter(mod_date__gt=F('pub_date') + timedelta(days=3))
|
||||
|
||||
The ``F()`` objects support bitwise operations by ``.bitand()`` and
|
||||
``.bitor()``, for example::
|
||||
The ``F()`` objects support bitwise operations by ``.bitand()``, ``.bitor()``,
|
||||
``.bitrightshift()``, and ``.bitleftshift()``. For example::
|
||||
|
||||
>>> F('somefield').bitand(16)
|
||||
|
||||
.. versionchanged:: 1.11
|
||||
|
||||
Support for ``.bitrightshift()`` and ``.bitleftshift()`` was added.
|
||||
|
||||
The ``pk`` lookup shortcut
|
||||
--------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user