New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #25912 --Added binary left/right shift operators to F expressions. #5815
Conversation
@@ -345,6 +345,8 @@ Miscellaneous | |||
* ``utils.version.get_version()`` returns :pep:`440` compliant release | |||
candidate versions (e.g. '1.10rc1' instead of '1.10c1'). | |||
|
|||
* The :class:`F expressions <django.db.models.F>` supported bitwise shift operators by ``>>`` and ``<<``.These operators are now available using ``.bitleftshift()`` and ``.bitrightshift()``. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to keep docs line length below 80 characters.
I think adding this would be good to add for completion. I'd say it's slightly less surprising to implement the bit shifting with maths on Oracle rather than raising |
All right, absent other feedback, I guess we'll proceed with this. Patch needs to be targeted at Django 1.11 and updated per Adam's comments. |
https://docs.oracle.com/cd/E22583_01/DR/help/Bit_Binary_Functions.html#DALc02a_2726006080_257082 Oracle implements this with |
I copied Oracle's implementation from BITAND but get queries: UPDATE "EXPRESSIONS_NUMBER" SET "THE_INTEGER" =
(BITAND("EXPRESSIONS_NUMBER"."THE_INTEGER",:arg0))
WHERE "EXPRESSIONS_NUMBER"."ID" = :arg fails: UPDATE "EXPRESSIONS_NUMBER" SET "THE_INTEGER" =
(BITSHIFT("EXPRESSIONS_NUMBER"."THE_INTEGER",:arg0))
WHERE "EXPRESSIONS_NUMBER"."ID" = :arg1 |
The linked documentation seems to be for something called "Document Automation Language (DAL)". I guess this is different than what the Oracle database supports. [From stackoverflow] (http://stackoverflow.com/questions/20085462/bit-shifting-with-and-operation-in-sql-select):
I'll try this approach. |
Updated in #7770. |
To be honest I have never heard about DAL, but I think that we can not use it in |
django-developers discussion