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)

Download files

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

Files for django-bitoptions, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size django_bitoptions-1.1.0-py2.py3-none-any.whl (5.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page