Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3788 Lượt xem

I have a list of products, and each have multiple variants. I look into product.template and product.product models, in which product.product inherits from product.template.

I want to program the script to insert those product:

for product in product list:

     Create a product to product.template

     Add all its variants to product.product

Is it the correct way to do this?

However, why can't we insert product to the template model, but only add extra info to the product model? Is there any document explaining how to do it?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 24
1660
1
thg 2 22
4537
0
thg 8 21
2670
1
thg 3 21
12135
2
thg 12 19
15950