A
A
Andrey Salnikov2018-04-18 12:03:58
Django
Andrey Salnikov, 2018-04-18 12:03:58

How to organize Products in Django?

So. There is a shop. Goods for it are delivered via API from the websites of different suppliers. Everyone has different data. Someone in XML, someone in JSON, etc.
On the site itself, the client requires the following structure to be organized:
The catalog displays products grouped by Color. That is, so that from the catalog you can go to the same product, but in a different color. Inside each color there is a list of the sizes of this product and you can put any of these sizes in the basket.
I organized something like this structure:

БазовыйТовар:
    Цвет:
        Размер
        Размер
    Цвет:
        Размер
        Размер

But in the end it turned out that, according to the API, some suppliers have goods grouped, others do not, etc.
Some items just don't have Sizes or Colors.
The problem is that a single Color or even Size may have its own price, for example.
In general, what is the idea for organizing Products? Offer any option, because my ideas did not end well for me.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
asd111, 2018-04-18
@asd111

jsonb in postgresql or mongodb

S
sim3x, 2018-04-18
@sim3x

EAV
json

T
tema_sun, 2018-04-18
@tema_sun

I store in json

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question