[Answered ]-How to get the model default value after creating new, without call another get?

1👍

It happens because you set id as non-editable. At the same time, model_to_dict returns a dictionary suitable for passing as a Form’s initial keyword argument.

You can easily check the source code of model_to_dict, and see that fields with such attribute set are skipped. Check this Convert Django Model object to dict with all of the fields intact it might be helpfull.

Leave a comment