This project replaces several related BooleanFields with a single 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
File details
Details for the file django_bitoptions-1.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_bitoptions-1.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 532d59f4ae1c541226f2e8c252df53bf2dce50b87bb42f6267fd08d34460b17d |
|
MD5 | f863cdff2e229310ac1f14a781aa77ff |
|
BLAKE2b-256 | d2561ff103e3be48e7be22a1624914898a6434eabf4e85bfee2b76a31bec9101 |