Comments (3)
Hi. You know I didn't even think about querying :) But you're right it would be very nice feature.
There is no bitwise lookups in Django though. I'll think about it for a while. Maybe new special lookups will be good solution for this.
from django-bitmask-field.
Bitwise lookups are undesirable from the database's perspective: Not all RDBMS support bitmask index and if your RDBMS does support it you would need to manually add that index.
The only thing that works well in an index (It works in BTREE and HASH indexes, BTREE is the default in most RDBMS) is an equal lookup on a bitmasked column, so if your bitmasked column is "1 | 4 | 16" the only filter that allows the usage of an index is 'bitmasked_column = 21'. Make sure you keep this in mind if you intend to filter on bigger sets of data.
In my opinion, this project is nice because it neatly adds it to the ORM and the Django admin. I do not want to filter on this field, I just want to get the masks after fetching the data with other filters.
from django-bitmask-field.
Django 3 added support for Choices
Not a bit mask, but getting closer.
from django-bitmask-field.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-bitmask-field.