Skip to main content

A wrapper around Django's choices.

Project description

# is a wrapper around Django's choices to make them easier to use.

## Example

from django.db import models

from choices import Choices

class Student(models.Model):

class Year(Choices):

def is_upperclass(self):
return self in (self.JUNIOR, self.SENIOR)

year_in_school = models.CharField(max_length=2, choices=Year.choices(),

def is_upperclass(self):
return self.Year(self.year_in_school).is_upperclass

## Installing

Install it from [PyPI]( with pip:

pip install

- Python 3.4+

Project details

Download files

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

Files for, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size (5.3 kB) File type Wheel Python version 3.6 Upload date Hashes View
Filename, size (3.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page