[Django]-Django Nested Inline Formsets to Populate Multilevel Nested Form

1πŸ‘

It is possible.
I presented it on the Pycon Ru 2021, and start to write articles about it:

https://dev.to/danilovmy/django-nested-inline-redering-4pfg

Shortly:

You can create Formset,
One field is this Formset – it is other Formset.
Here is a little bit hard plate, how to achieve correct id for every fields.
You need also override "is_changed" for field. And the save method.

Biggest problem in Nested – multiuser work.
If one user change something, that right now changed other user – you can get complex bug in DB-consistency

πŸ‘€Maxim Danilov

Leave a comment