2021年1月5日星期二

Django and React - Models for adding multiple data fields - Material UI

I am using Django for my backend and react for my frontend to build a web application that calculates cost based on the total volume (calculated using dimensions lwh) of some boxes. In order to do that, I created a form using React and Material UI in which there is an ADD MORE button to add the dimensions of multiple additional boxes.

Although I managed to create a model in case there is only one box and store the values in the database, I don't know how this will work when I use the ADD MORE button. How can I create my Django model to store the dimensions and volume for each additional box of the form?

I checked several other threads and found out about Formsets but I don't know how to apply it in my case.

Thanks in advance for your help :)

https://stackoverflow.com/questions/65588807/django-and-react-models-for-adding-multiple-data-fields-material-ui January 06, 2021 at 09:06AM

没有评论:

发表评论