I have two models Category and Products.
- a Product can have multiple Categories
- a Category can have multiple Products.
- Categories have a circular Foreign key, to itself.
- not all Categories have the same depth level
Example:
Category A
- Category A_1
- category A_2
I have two models Categories and Products.
A Product can have multiple Categories, a Category can have multiple
Products.
The Categories have a circular Foreign key, to itself.
class Product:
categories = models.ManyToManyField(Category)
name = models.CharField(max_length=2
2 matches
Mail list logo