mirror of
https://github.com/django/django.git
synced 2025-11-01 20:31:40 +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:
parent
f0ef0c49e9
commit
1c12df4aa6
7 changed files with 37 additions and 5 deletions
|
|
@ -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
|
||||
--------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue