How to display Foreign Key's choices in django-admin?
<p>I have small problem related to django-admin panel.
I have 2 models:</p>

<pre><code>from django.db import models

class Subject(models.Model):
    subject = models.CharField(max_length=30, choices=[('P', 'Personal'), ('W', 'Work')])

    def __str__(self):
        return self.subject

class BlogPost(models.Model):
    id = models.AutoField(unique=True, primary_key=True)
    subject = models.ForeignKey(Subject, on_delete=models.CASCADE)
    text = models.TextField(null=False)
    pic = models.ImageField(upload_to='static/img/', default='static/img/no-image.png')
    date = models.DateTimeField()

    def __str__(self):
        return self.subject
</code></pre>

<p>But in admin panel whenever I try to create blog post, dropdown menu doesn't show any of subject's choices. Do I need to edit admin render function ?</p>

<p>By the way you have done it you have to first add the subjects themselves so they can appear in your foreign key choices. you could have the same results by:</p>

<pre><code>class BlogPost(models.Model):
    id = models.AutoField(unique=True, primary_key=True)
    subject = models.CharField(max_length=30, choices=[('P', 'Personal'), ('W', 'Work')])

    def __str__(self):
        return self.subject
</code></pre>

<p>What do you want the ForeignKey for?</p>

python django