This project replaces several related BooleanFields with asingle field and a few eye candy features.
Project description
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
Close
Hashes for django_bitoptions-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf2d1893981265773eb1026ba4a11cee73bc1ec2c99e91c507601ec619b17543 |
|
MD5 | e808d1388637c0e2d66367b90893cd97 |
|
BLAKE2b-256 | 5eb5b144462d5cdce44d8c4d0aa5ec70408716e6777ce97d1272050325b93a57 |