The deconstruct() method is used to migrate a model that cannot be automatically processed by the system. Let me go through the scenario where deconstruction will be called.
Let's say we had some kind of model, and we added a custom field to it. We are trying to migrate using python manage.py makemigrations .
We encounter the following error:
ValueError: Cannot serialize: Foo There are some values Django cannot serialize into migration files.
It turned out that there already exists a linked ticket that was submitted to the Django project, and check it out.

One of the main developers answered that this is the intended behavior, because our field contains the called.

So, we missed something in the documentation. The called value is stored there, and for some reason it cannot be automatically transferred. What we can do?
Well, in addition to telling us about ValueError , manage.py also gave us a useful documentation link:

On this page, scroll down a bit until we get to the section on serializing values .
Django can serialize the following:
- ...
- All that the user-defined deconstruct () method has (see below)
- ...
Ok, let see below :
You can let Django serialize its own instances of the class by providing the class method deconstruct (). It takes no arguments and should return a tuple of three things (path, args, kwargs):
- the path must be the Python path for the class with the class name included as the last part (for example, myapp.custom_things.MyClass). If your class is not available at the top level of the module, this is not serialization.
- args should have a list of positional arguments to jump to your init class. Everything on this list should be serializable.
- kwargs must be a keyword argument to go to your init class. Each value must be serialized.
Note that the deconstruct () method works hand in hand with __eq__() , as stated in the documentation:
To prevent creating a new migration every time you run makemigrations, you must also add the __ eq __ () method to the decorated class. This feature will be called by the Djangos migration framework to detect changes between states.
In my case, the mistake was to add brackets after the value that should not have been called, but in many cases you will want to implement this method of deconstructing for migration. (Here is another useful link that has an example.)