title: In Django, how do I define a string value for IntegerChoices enum?
body: <p>I'm using Django 3.2 and Python 3.9.  In my model, I define an int enum.  I would also like to define readable string values for it, so I tried</p>
  <pre><code>class Transaction(models.Model):
      class TransactionTypes(models.IntegerChoices):
          BUY = 0
          SELL = 1
  
          labels = {
              BUY: 'Buy',
              SELL: 'Sell'
          }
  
          translation = {v: k for k, v in labels.items()}
  </code></pre>
  <p>but this definition fails with the error</p>
  <pre><code>TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict'
  </code></pre>
  <p>How would I define strings for each value?  I don't mind if the strings are just the literal variable names (e.g. &quot;BUY&quot;, &quot;SELL&quot;)</p>
  <p><b>Edit:</b> In response to the one of the answers given, seeing this result ...</p>
  <pre><code>&gt;&gt;&gt; t = Transaction.objects.all().first()
  &gt;&gt;&gt; t.type
  0
  &gt;&gt;&gt; str(t.type)
  '0'
  </code></pre>