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://www.quantifiedcode.com/api/v1/project/9d2810191a234414a3edf7843f5d1c1c/badge.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.0.1-py2.py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 2 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