title: Django Model - Charfield with choices from a row in another model?
body: <p>I have created a settings table in Django as per the below:-</p>
  
  <pre><code>class Settings(models.Model):
      name = models.CharField(max_length=200)
  
      class Meta:
          verbose_name = "Settings"
          verbose_name_plural = "Settings"    
  
      def __str__(self):
          return self.name  
  
  class SettingChoices(models.Model):   
      setting = models.ForeignKey(Settings, on_delete=models.PROTECT) 
      choice = models.CharField(max_length=200)    
      class Meta:
          verbose_name = "Setting Choices"
          verbose_name_plural = "Setting Choices"    
  
      def __str__(self):
          return '{0} - {1}'.format(self.setting, self.choice)   
  </code></pre>
  
  <p>and a sample use of this would be:-</p>
  
  <pre><code>Setting = Circuit Type:
  Choices:
   DSL
   4G
   Fibre
  </code></pre>
  
  <p>then in another model I want to be able to reference this as set of choices</p>
  
  <pre><code>class Circuits(models.Model):
      site_data = models.ForeignKey(SiteData, verbose_name="Site", on_delete=models.PROTECT)
      order_no = models.CharField(max_length=200, verbose_name="Order No")
      expected_install_date = models.DateField()
      install_date = models.DateField(blank=True, null=True)
      circuit_type = models.CharField(max_length=100, choices=*** here I would get model settings - Circuit Type - Choices ***)
  </code></pre>
  
  <p>currently I use a list in settings.py but its not fluid, I need my users to be able to alter these settings not for me to manually edit a list in settings.py and push changes each time</p>
  
  <p>I attempted the below:</p>
  
  <p>functions.py</p>
  
  <pre><code>def settings_circuit_types():
      from home.models import SettingChoices
      type_data = SettingChoices.objects.filter(setting__name='CIRCUIT_TYPES')
      circuit_types = []
      for c in type_data:
          circuit_types.append(c.choice)
      return circuit_types
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>from app.functions import settings_circuit_types
  CIRCUIT_CHOICES = settings_circuit_types()
  ...
  circuit_type = models.CharField(max_length=100, choices= CIRCUIT_CHOICES)
  </code></pre>
  
  <p>but this has thrown an error</p>
  
  <pre><code>dango.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.
  </code></pre>
  
  <p>which is understandable, im wondering if what im trying to achieve is possible by other means?</p>
  
  <p>Thanks</p>