You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the below scenario, how to display the subcategories of the selected category only in admin site? Chained ForeignKey/ Chained Many to Many doesn't provide such use case..
class Category(models.Model):
name = models.CharField(max_length=20)
class SubCategory(models.Model):
name = models.CharField(max_length=20)
category= models.ForeignKey(Category)
class Course(models.Model):
name = models.CharField(max_length=20)
category= models.ForeignKey(Category)
subcategory=models.ManytoManyField(SubCategory)
The text was updated successfully, but these errors were encountered:
In the below scenario, how to display the subcategories of the selected category only in admin site? Chained ForeignKey/ Chained Many to Many doesn't provide such use case..
class Category(models.Model):
name = models.CharField(max_length=20)
class SubCategory(models.Model):
name = models.CharField(max_length=20)
category= models.ForeignKey(Category)
class Course(models.Model):
name = models.CharField(max_length=20)
category= models.ForeignKey(Category)
subcategory=models.ManytoManyField(SubCategory)
The text was updated successfully, but these errors were encountered: