I can not get the second level (subcategory/E_cat) drop down to populate. First level (Category) seems to be working fine. I think I\'ve tried just about every reasonable combi
html.file
include the following if you are using forms
models.py
class Continent(models.Model):
name = models.CharField(max_length=255)
def __str__(self):
return self.name
class Country(models.Model):
continent= models.ForeignKey(Continent)
name = models.CharField(max_length=255)
def __str__(self):
return self.name
class City(models.Model):
continent= models.ForeignKey(Continent)
country= ChainedForeignKey(Country, chained_field="continent", chained_model_field="continent", show_all=False, auto_choose=True, sort=True)
name = models.CharField(max_length=255)
def __str__(self):
return self.name
class Neighborhood(models.Model):
continent= models.ForeignKey(Continent)
country= ChainedForeignKey(Country, chained_field="continent", chained_model_field="continent", show_all=False, auto_choose=True, sort=True)
name = models.CharField(max_length=255)
city= ChainedForeignKey(City, chained_field="country", chained_model_field="country", show_all=False, auto_choose=True, sort=True)
name = models.CharField(max_length=255)
def __str__(self):
return self.name
admin.py
admin.site.register(Component)
admin.site.register(Group)
admin.site.register(Failure)
admin.site.register(Neighborhood)