title: How to store python classes into a database with Django?
body: <p>I have two files:</p>
  
  <p><strong><em>choices.py</em></strong></p>
  
  <pre><code>class SomeChoice:
      name = u"lorem"
  
  class AnotherChoice:
      name = u"ipsum"
  
  # etc...
  </code></pre>
  
  <p><strong><em>models.py</em></strong></p>
  
  <pre><code>from django.db import models
  import choices
  
  class SomeModel(models.Model):
      CHOICES = (
          (1, choices.SomeChoice.name),
          (2, choices.AnotherChoice.name),
          # etc...
      )
      somefield = models.IntegerField('field', choices=CHOICES)
  </code></pre>
  
  <p>The problem: classes from choices.py need something like a primary key to be stored in my database. Here I write these keys (1, 2, ...) by hand, but this is ugly.</p>
  
  <p>For instance, I don't want to do that:</p>
  
  <pre><code>class SomeChoice:
      id = 1
      name = "lorem"
  
  class AnotherChoice:
      id = 2
      name = "lorem"
  </code></pre>
  
  <p>So my question is: <strong>what is the best way to store python classes into a database</strong> ?</p>
  
  <p>Please excuse my ugly english. If you need more informations, just tell me. ;-)</p>