title: How to use enums as a choice field in django model
body: <p>I have a model class of which I want two fields to be a choice fields, so to populate those choices I am using an enum as listed below</p>
  
  <pre><code>#models.py
  class Transaction(models.Model):
      trasaction_status = models.CharField(max_length=255, choices=TransactionStatus.choices())
      transaction_type = models.CharField(max_length=255, choices=TransactionType.choices())
  
  #enums.py
  class TransactionType(Enum):
  
      IN = "IN",
      OUT = "OUT"
  
      @classmethod
      def choices(cls):
          print(tuple((i.name, i.value) for i in cls))
          return tuple((i.name, i.value) for i in cls)
  
  class TransactionStatus(Enum):
  
      INITIATED = "INITIATED",
      PENDING = "PENDING",
      COMPLETED = "COMPLETED",
      FAILED = "FAILED"
      ERROR = "ERROR"
  
      @classmethod
      def choices(cls):
          print(tuple((i.name, i.value) for i in cls))
          return tuple((i.name, i.value) for i in cls)
  </code></pre>
  
  <p>However, when I am trying to access this model through admin I am getting the following error :</p>
  
  <pre><code>Django Version: 1.11
  Exception Type: ValueError
  Exception Value:    
  too many values to unpack (expected 2)
  </code></pre>
  
  <p>I followed two articles that described how to use enums:</p>
  
  <ul>
  <li><a href="https://hackernoon.com/using-enum-as-model-field-choice-in-django-92d8b97aaa63" rel="noreferrer">https://hackernoon.com/using-enum-as-model-field-choice-in-django-92d8b97aaa63</a></li>
  <li><a href="https://blog.richard.do/2014/02/18/how-to-use-enums-for-django-field-choices/" rel="noreferrer">https://blog.richard.do/2014/02/18/how-to-use-enums-for-django-field-choices/</a></li>
  </ul>