Skip to main content

BitmaskField implementation for Django ORM

Project description

BitmaskField implementation for Django ORM

https://travis-ci.org/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
    )

Admin site:

https://github.com/renskiy/django-bitmask-field/blob/master/BitmaskFormField.png

Install

pip install django-bitmask-field

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-bitmask-field-0.1.2.tar.gz (14.6 kB view hashes)

Uploaded Source

Built Distribution

django_bitmask_field-0.1.2-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page