I have Product and Categories. A product can be in multiple categories and 
off course a Category have multiple products.


The Categories can have Subcategories’ which can have Subcategories. I used 
a Category Model with a circular Foreign Key.


Each Product can have specifications/attributes based in which Categories 
is. 


So the specifications are of the products but depends on the Categories.


I can’t add the specifications as Products attributes because they depend 
on categories, and the user can change categories.


I can’t add them as attributes per Category because the value are/can be 
different for each product.


Also an attribute/specification can appear in multiple Categories.


I want also to search for a Product filtering by attributes.


I think I need a separate Attribute Model that is linked (foreign key) to 
both Product and Category.


Also a way of “protection” in case a Product change categories, a Product 
and/or a Category is deleted.


What is the optimal approach as flexibility and performance ? 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/adf6c608-45fd-4c5f-a8c1-7a11b67fc3b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to