How to initialize an inline formset and do some custom validations

Django admin inline prefilled

April 2020

You can find the source code in this repository

In previous tutorial we have seen how to add inlines in our django admin for Shop and Product models. This tutorial explains how to go a step further. Let’s imagine our user has set the planning for his shop and now you like to add a new product. It could be nice to avoid him setting again the planning for the product and so to initialize it with the planning of the shop as default values.

Continue Reading