Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

is the desired implementation -->https://code.djangoproject.com/ticket/25912#comment:10

81 views
Skip to first unread message

Sarabia Cobo Belén

unread,
Jul 9, 2016, 10:31:33 AM7/9/16
to Django developers (Contributions to Django itself)
Hello everyone,

 I create this thread to know if it is desired ticket 25919 or not?, or I should close that pull request?

Thank very much, and sorry for the inconvinients created.

Tim Graham

unread,
Jul 9, 2016, 11:09:53 AM7/9/16
to Django developers (Contributions to Django itself)
Hi, you're more likely to inspire a good discussion if you summarize the discussion on the ticket and offer your own opinion on the matter.

Sarabia Cobo Belén

unread,
Jul 10, 2016, 9:45:17 AM7/10/16
to Django developers (Contributions to Django itself)

Hi!,
the summary of this ticket is:
add  bit shift operators (concretely '>>' and '<<')  to F(), then you can use these operators like this:
  - F('somefield').bitleftshift(16)
  - F('somefield').bitrightshift(16)

The discussion of this ticket went in few ways:

    1)  We permit these operators in F(), and then we allow addition of others methods too?
    2)  Move the bitand() and bitor() to expressions?
    3) Or only allow bit shift and stop there. (Into this way there are open other discussions):
                  3.1) situation->Oracle don't support bit shift operators, but you can do some math to do it
                                  3.1.1) Is a good idea to implement this maths?
                                  3.1.2) Or is better to raise NotImplementedError("Bit-wise left/right is not supported in Oracle."), because we want to follow the same design following by Django in other cases like this? such as 'or' operator: (you can check the code):
                                                       In django/django/db/backends/oracle/features.py

                                                       supports_bitwise_or = False

                                                       In django/django/db/backends/oracle/operations.py

                                                      def combine_expression(self, connector, sub_expressions):
                                                                ....
                                                      elif connector == '|':

                                                      raise NotImplementedError("Bit-wise or is not supported in Oracle.")
   

The pull request has the solution 3.1.2, implement binary left/right shift operators to F() and raise NotImplementedError for Oracle.

All opinions are welcome! thank you so much!
Reply all
Reply to author
Forward
0 new messages