Django admin page dropdowns

Posted by zen on Stack Overflow See other posts from Stack Overflow or by zen
Published on 2010-05-09T23:20:15Z Indexed on 2010/05/09 23:28 UTC
Read the original article Hit count: 215

Filed under:
|
|
|

I am building a high school team application using Django.

Here is my working models file:

class Directory(models.Model):
    school = models.CharField(max_length=60)
    website = models.URLField()
    district = models.SmallIntegerField()
    conference = models.ForeignKey(Conference)
class Conference(models.Model):
    conference_name = models.CharField(max_length=50)
    url = models.URLField()
    class Meta:
        ordering = ['conference_name']

When I open my admin pages and go to edit a school's conference the drop down looks like this:

<select>
<option value="1">Conference Object</option>
<option value="2">Conference Object</option>
<select>

How do I replace "Conference Object" with the conference_name?

© Stack Overflow or respective owner

Related posts about django

Related posts about admin