|
@@ -514,7 +514,11 @@ class Field(RegisterLookupMixin):
|
|
|
# instance. The code below will create a new empty instance of
|
|
|
# class self.__class__, then update its dict with self.__dict__
|
|
|
# values - so, this is very close to normal pickle.
|
|
|
- return _empty, (self.__class__,), self.__dict__
|
|
|
+ state = self.__dict__.copy()
|
|
|
+ # The _get_default cached_property can't be pickled due to lambda
|
|
|
+ # usage.
|
|
|
+ state.pop('_get_default', None)
|
|
|
+ return _empty, (self.__class__,), state
|
|
|
return _load_field, (self.model._meta.app_label, self.model._meta.object_name,
|
|
|
self.name)
|
|
|
|