samedi 9 avril 2022

What is the best way to design model in given context?

I'm stuck on this problem. Basically i've got a data structure like this:

                "Manufacturer": [
                    {
                        "model": "Model",
                        "models": [
                            {
                                "color": "black",
                                "condition": "C",
                                "memory": "32 GB",
                                "price": 9999999
                            },
                            {
                                "color": "black",
                                "condition": "D",
                                "memory": "32 GB",
                                "price": 999999
                            },
                            {
                                "color": "black",
                                "condition": "NC",
                                "memory": "32 GB",
                                "price": 99999
                            }
                        ]
                    }
                ]
            }

I want to make a view where there'll be a droplist with "Manufacturer" list, a droplist for all models of chosen manufacturer, and a droplists for condition and memory capacity. So i'm stuck with desingning a model that I need to pass to the view. Any suggestions on how should I design it and what are the best practicies?

Aucun commentaire:

Enregistrer un commentaire