#31396: Add support for bitwise XOR to expressions.
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bitwise xor | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):
* stage: Unreviewed => Accepted
Comment:
Replying to [ticket:31396 Hannes Ljungberg]:
> Bitwise XOR is supported by all backends except sqlite. It could be
implemented on sqlite as something like `((%(lhs)s | %(rhs)s) - (%(lhs)s &
%(rhs)s))` but the way `CombinedExpression.as_sql` is implemented makes it
a bit tricky to repeat the right-hand side binding:
> `((“left_hand_side_expr" | %s) - ("left_hand_side_expr" & %s)) % (rhs,)`
.
You can override a `bitxor` operator (e.g. `#`) in
`DatabaseOperations.combine_expression()` for each backend.
--
Ticket URL: <https://code.djangoproject.com/ticket/31396#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.244cf0fa3d2fc2ee3bc8861a2d929292%40djangoproject.com.