Skip to content

Instantly share code, notes, and snippets.

@jan-matejka
Created October 12, 2012 10:28
Show Gist options
  • Select an option

  • Save jan-matejka/3878603 to your computer and use it in GitHub Desktop.

Select an option

Save jan-matejka/3878603 to your computer and use it in GitHub Desktop.
django model choices field
A = 1
B = 2
C = 3
STATUS_CODES = (
(A, _(u'A')),
(B, _(u'B')),
(C, _(u'C')),
)
state = models.IntegerField(choices=STATUS_CODES, default=A,
verbose_name=_('Status'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment