[Fixed]-Customize dropdown list from django admin panel

1👍

If the choices are going to change, use a separate model for the type. That will give you a lot more flexibility.

class Industry(models.Model):
    type = ForeignKey('IndustryType')
    ...

class IndustryType(models.Model):
    type_name = models.CharField(max_length=30)

    def __str__(self):  # use __unicode__ for Python 2
        return self.type_name

The Industry admin form will put a green + next to the type dropdown. That will let you add a new type, which will be added to the dropdown.

Leave a comment