django_evolution.compat.picklers
Picklers for working with serialized data.
Classes
|
Unpickler compatible with changes to Django class/module paths. |
|
Compatibility for unpickling a SortedDict. |
- class django_evolution.compat.picklers.SortedDict(*args, **kwargs)
Bases:
dict
Compatibility for unpickling a SortedDict.
Old signatures may use an old Django
SortedDict
structure, which does not exist in modern versions. This changes any construction of this data structure into acollections.OrderedDict
.- static __new__(cls, *args, **kwargs)
Construct an instance of the class.
- Parameters:
- Returns:
The new instance.
- Return type:
- class django_evolution.compat.picklers.DjangoCompatUnpickler(file, *, fix_imports=True, encoding='ASCII', errors='strict')
Bases:
_Unpickler
Unpickler compatible with changes to Django class/module paths.
This provides compatibility across Django versions for various field types, updating referenced module paths for fields to a standard location so that the fields can be located on all Django versions.
- find_class(module, name)
Return the class for a given module and class name.
If looking up a class from
django.db.models.fields
, the class will instead be looked up fromdjango.db.models
, fixing lookups on some Django versions.- Parameters:
- Returns:
The resulting class.
- Return type:
- Raises:
AttributeError – The class could not be found in the module.