https://github.com/renskiy/django-bitmask-field
BitmaskField implementation for Django
https://github.com/renskiy/django-bitmask-field
bitmask django
Last synced: 5 months ago
JSON representation
BitmaskField implementation for Django
- Host: GitHub
- URL: https://github.com/renskiy/django-bitmask-field
- Owner: renskiy
- License: mit
- Created: 2017-07-31T06:30:54.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-06-12T17:27:59.000Z (over 2 years ago)
- Last Synced: 2025-04-03T21:04:16.766Z (6 months ago)
- Topics: bitmask, django
- Language: Python
- Size: 28.3 KB
- Stars: 9
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
====================
django-bitmask-field
====================BitmaskField implementation for `Django`_ ORM
.. image:: https://app.travis-ci.com/renskiy/django-bitmask-field.svg?branch=master
:target: https://app.travis-ci.com/renskiy/django-bitmask-field.. image:: https://coveralls.io/repos/github/renskiy/django-bitmask-field/badge.svg?branch=master
:target: https://coveralls.io/github/renskiy/django-bitmask-field?branch=master.. _Django: https://www.djangoproject.com
Requirements
------------* Python 2.7 or Python 3.4+
* Django 1.8+Example
-------.. code-block:: python
from django.db import models
from django_bitmask_field import BitmaskFieldclass 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
-------.. code-block:: bash
pip install django-bitmask-field