Skip to main content

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

Project description

https://img.shields.io/travis/amateja/django-bitoptions.svg 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.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_bitoptions-1.1.0-py2.py3-none-any.whl (5.6 kB) Copy SHA256 hash SHA256 Wheel py2.py3

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page