diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index 281963f..7b8c65e 100644
a
|
b
|
class Field(object):
|
132 | 132 | memodict[id(self)] = obj |
133 | 133 | return obj |
134 | 134 | |
| 135 | def __getstate__(self): |
| 136 | obj_dict = self.__dict__.copy() |
| 137 | obj_dict['default'] = None |
| 138 | return obj_dict |
| 139 | |
| 140 | def __setstate__(self, data): |
| 141 | self.__dict__.update(data) |
| 142 | |
| 143 | # Restore the default |
| 144 | for field in self._model._meta.fields: |
| 145 | if self.name == field.name: |
| 146 | self.default = field.default |
| 147 | |
| 148 | |
135 | 149 | def to_python(self, value): |
136 | 150 | """ |
137 | 151 | Converts the input value into the expected Python data type, raising |
… |
… |
class Field(object):
|
233 | 247 | |
234 | 248 | def contribute_to_class(self, cls, name): |
235 | 249 | self.set_attributes_from_name(name) |
| 250 | self._model = cls |
236 | 251 | cls._meta.add_field(self) |
237 | 252 | if self.choices: |
238 | 253 | setattr(cls, 'get_%s_display' % self.name, curry(cls._get_FIELD_display, field=self)) |