I want to create a model that will organize my children's models accordingly. For example, a book has many chapters, but the chapters must be in a certain order.
I assume that I need to put IntegerField in a chapter model that defines the order of the chapters, for example the following question: Ordered lists in django
My main problem is that whenever I want to insert a new chapter between two existing chapters or to reorder them in any way, I need to update (almost) every chapter in the book. Is there a way (possibly in Django Admin that I use) to avoid having to manually change each index in each chapter whenever I change the order?
I am not a big fan of creating a Linked List style model, as suggested in the above question, because I have the impression that it is not a good practice to create a database.
What is the “right” way to model this relationship?
source
share