Giter Club home page Giter Club logo

Comments (3)

renskiy avatar renskiy commented on July 17, 2024

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.

michaeldg avatar michaeldg commented on July 17, 2024

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.

shlomoa avatar shlomoa commented on July 17, 2024

Django 3 added support for Choices
Not a bit mask, but getting closer.

from django-bitmask-field.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.