Skip to main content

This project replaces several related BooleanFields with a single field and a few eye candy features.

Project description

https://img.shields.io/github/actions/workflow/status/amateja/django-bitoptions/python-test.yml https://img.shields.io/coveralls/amateja/django-bitoptions.svg https://img.shields.io/pypi/v/django-bitoptions.svg https://img.shields.io/pypi/format/django-bitoptions.svg https://img.shields.io/pypi/pyversions/django-bitoptions.svg https://img.shields.io/pypi/status/django-bitoptions.svg https://img.shields.io/pypi/l/django-bitoptions.svg

django-bitoptions

This project replaces several related BooleanFields with a single field and a few eye candy features.

installation

pip install django-bitoptions

usage

from django.db import models
from bitoptions import BitOptions, BitOptionsField

TOPPINGS = BitOptions(
    ('pepperoni', 'mushrooms', 'onions', 'sausage', 'bacon',
     'black olives', 'green olives', 'green peppers', 'pineapple',
     'spinach', 'tomatoes', 'broccoli', 'jalapeno peppers', 'anchovies',
     'chicken', 'beef', 'ham', 'salami')
)
CHEESES = BitOptions(('feta', 'parmesan', 'provolone', 'goat',
                      'mozzarella'))


class Pizza(models.Model):
    toppings = BitOptionsField(options=TOPPINGS)
    cheeses = BitOptionsField(options=CHEESES)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_bitoptions-1.1.1-py2.py3-none-any.whl (7.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django_bitoptions-1.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_bitoptions-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 532d59f4ae1c541226f2e8c252df53bf2dce50b87bb42f6267fd08d34460b17d
MD5 f863cdff2e229310ac1f14a781aa77ff
BLAKE2b-256 d2561ff103e3be48e7be22a1624914898a6434eabf4e85bfee2b76a31bec9101

See more details on using hashes here.

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