Skip to content

renskiy/django-bitmask-field

Repository files navigation

django-bitmask-field

BitmaskField implementation for Django ORM

https://app.travis-ci.com/renskiy/django-bitmask-field.svg?branch=master https://coveralls.io/repos/github/renskiy/django-bitmask-field/badge.svg?branch=master

Requirements

  • Python 2.7 or Python 3.4+
  • Django 1.8+

Example

from django.db import models
from django_bitmask_field import BitmaskField


class MyModel(models.Model):

    bitmask = BitmaskField(
        choices=[(1, 'bit0'), (2, 'bit1'), (4, 'bit2')],  # available choices
        default=1 | 4,  # bit0 and bit2 are enabled by default
    )

Install

pip install django-bitmask-field

About

BitmaskField implementation for Django

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages