Open alex opened 12 years ago
Happening.
Also happening:
>>> Model.objects.filter(bitfield__xor='110101')
>>> Model.objects.update(bitfield=B('bitfield') ^ '110101')
Et cetera. I like ExpressionNode
for this kind of stuff.
Awesome, didn't see it noted in the "future" section, so I figured I'd bring it up.
Yup. Seems easy enough to implement; I may be able to get it done this arvo.
OK. Not that easy to implement.
There's a basic implementation of the BIT
and VARBIT
types here. There’s also a B()
-expression syntax thing for manipulating bit strings atomically; see these test cases for a short example.
The biggest problem, currently, is the implementation of custom query predicates based on the bitwise operators. Stuff like __xor
, which I think would be really useful. Also, I’d love a query aggregate like popcount()
, but apparently Postgres doesn’t even have that built-in.
PostgreSQL has awesome support for bit fields, this should support 'em!