mirror of
https://github.com/django/django.git
synced 2025-10-05 00:00:37 +00:00
Fixed #13328 -- Added a __getstate__/__setstate__ pair to fields so that callable default values aren't pickled. Thanks to bkonkle for the report, and Vitaly Babiy for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12977 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
d9aaad4e36
commit
2faa3acb4b
6 changed files with 49 additions and 6 deletions
|
@ -104,11 +104,11 @@ class Options(object):
|
|||
self.db_table = "%s_%s" % (self.app_label, self.module_name)
|
||||
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
|
||||
|
||||
|
||||
def _prepare(self, model):
|
||||
if self.order_with_respect_to:
|
||||
self.order_with_respect_to = self.get_field(self.order_with_respect_to)
|
||||
self.ordering = ('_order',)
|
||||
self._order = OrderWrt(model)
|
||||
else:
|
||||
self.order_with_respect_to = None
|
||||
|
||||
|
@ -331,7 +331,7 @@ class Options(object):
|
|||
for f, model in self.get_fields_with_model():
|
||||
cache[f.name] = (f, model, True, False)
|
||||
if self.order_with_respect_to:
|
||||
cache['_order'] = OrderWrt(), None, True, False
|
||||
cache['_order'] = self._order, None, True, False
|
||||
if app_cache_ready():
|
||||
self._name_map = cache
|
||||
return cache
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue