Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

A wrapper around Django's choices.

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


from django.db import models

from choices import Choices

class Student(models.Model):

    class Year(Choices):

        FRESHMAN = 'FR'
        SOPHOMORE = 'SO'
        JUNIOR = 'JR'
        SENIOR = 'SR'

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

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

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


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.

Filename, size & hash SHA256 hash help File type Python version Upload date (4.3 kB) Copy SHA256 hash SHA256 Wheel py2.py3 (3.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page