I have the following Models :
class Country(models.Model):
title = models.CharField(max_length=40)
class City(models.Model):
title = models.CharField(max_length=40)
country = models.ForeignKey(Country, on_delete=models.CASCADE)
class Case(models.Model):
title = models.CharField(max_length=40)
country = models.ForeignKey(Country, on_delete=models.CASCADE)
city = models.ForeignKey(City, on_delete=models.CASCADE)
In the Django admin of the Case page, I want to implement the chained dropdown select between country and city. If the user choose USA from the country list, the city list will show only cities of USA.
From other questions here, I see that i have to use 'list_select_related'. but that doesn't work with me.
Is there any simple way to implement that ?