Skip to content

Instantly share code, notes, and snippets.

@stingh711
Created May 8, 2019 05:58
Show Gist options
  • Save stingh711/aff679eebe339ecfc93fd454cfba1dd4 to your computer and use it in GitHub Desktop.
Save stingh711/aff679eebe339ecfc93fd454cfba1dd4 to your computer and use it in GitHub Desktop.
[django-modesl-utils]
from model_utils.fields import StatusField
from model_utils import Choices
class Article(models.Model):
ANOTHER_CHOICES = Choices('draft', 'published')
# ...
another_field = StatusField(choices_name='ANOTHER_CHOICES')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment