13👍
✅
By using Google I managed to find that it is part of Django:
https://docs.djangoproject.com/en/stable/topics/migrations/#adding-a-deconstruct-method
As long as all of the arguments to your class’ constructor are themselves serializable, you can use the @deconstructible class decorator from django.utils.deconstruct to add the deconstruct() method
6👍
def deconstructible(*args, **kwargs):
"""
Class decorator that allow the decorated class to be serialized
by the migrations subsystem.
Accepts an optional kwarg `path` to specify the import path.
"""
- Django + Forms: Dynamic choices for ChoiceField
- Validating a Django model field based on another field's value?
- How to unit test a form with a captcha field in django?
Source:stackexchange.com