Skip to content

Instantly share code, notes, and snippets.

@stephane
Last active August 26, 2015 20:23
Show Gist options
  • Save stephane/bbddfc280cd07f8f4769 to your computer and use it in GitHub Desktop.
Save stephane/bbddfc280cd07f8f4769 to your computer and use it in GitHub Desktop.
ArrayField in Django 1.8
class Issue(models.Model):
LABEL_CHOICES = (
('bug', "Bug"),
('feature', "Feature"),
('blocker', "Release blocker"),
)
title = models.CharField(max_length=256)
labels = ArrayField(
models.CharField(max_length=32, choices=LABEL_CHOICES),
default=[], blank=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment