I have two models basically the category and the product (having a foreign field related to the category). Several categories have been created through the admin page and next would be creating the products under each category.
I would like to know in Django Admin, if there is a way I could click on the individual category and create a product directly under the category I selected.
Note that I understand I can create a product and select the category directy, but I just want to know if I can do it from the category side.
Thank you.
# my models
class Category(models.Model):
code = models.CharField(max_length=45, unique=True)
name = models.CharField(max_length=45)
class Product(models.Model):
part_number = models.CharField(max_length=45, unique=True)
category = models.ForeignKey(Category, on_delete=models.RESTRICT)
brand = models.CharField(max_length=45, blank=True, null=True)
specification = models.CharField(max_length=45)
Currently I have