Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use smart-selects for a many to many field against a foreign key selection in django admin? #329

Open
skalluri01 opened this issue Mar 18, 2021 · 0 comments

Comments

@skalluri01
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant