I have come across many of the articles from this site on my (short) 6month django journey. They usually solved my questions so I am trying my luck here.
I have been grinding on an issue for weeks now. So much so I decided to create a workaround for the demo. The demo went well and I have a live project at work. And now, the problem returns to bite me in the a**.
Ill get right to the point and try and explain what I need:
- I am trying to create a combined PIM / PricingModel webapp.
- The pim mainly revolves around the model “ProductItem”
I need the ProductItem to have attribute fields like: (This is a fraction but enough to get the point)
That way I can run tests in the pricing-model-app which takes the equipment that uses_x_inputs and make sure you have the corresponding equipment that has enough inputs.
I have a model Type (ProductItem foreign key) which is the type of equipment (e.i. Camera, Sensor etc). I want to put the attributes as fields in this model and i would like them to be dynamic. This way if there is a new attribute I do not have to perform a migration.
On the admin/user side I would like to have:
- The attributes to show up automatically when the user/admin chooses type.
A ProductItem would look like this:
ProductItem: name = camera description = seesthings type = camera-analysis camera-analysis: <sensors|is_dynamic|has_default>=<1|is_dynamic|has_default> <Input|is_dynamic|has_default>=<2|is_dynamic|has_default> <UserNeedsNewField>
How would you go about building this Model/DB/admin structure.
Please feel free to ask ANY questions.
PS: I dont need the answer on a silver platter, I need help finding the right structure for further down the line so i dont have to micromanage models everytime someone has a product that has new subattributes, so to speak ;).