Planning out relation and form type

Hello,

I wanted to keep track of inventory. In this system I would have a box and in the box are objects, max 12 but at least 1. I originally had it set up so the box is the parent and the objects are the children. Also make it possible that the children could change parents. I wanted to keep track of the movement of the children. I did use an inline form, but I wanted to ask if there would be a better method to do this or any recommendations or things I can consider. I also tried ModelFormset Factory, I thought this way would be better to keep track of the object “child”.

Welcome @M189191 !

You’re on the right track here. The objects would have a ForeignKey to the box, establishing a Many-to-one relationship between the models. From there, moving an object from one box to another consists of changing the ForeignKey reference.

Hello,

Yes this is what I thought would be the possibility. I would add that possibility to change the box for each of these objects on the form. Thank you.