diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-04-15 12:41:08 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-04-15 12:41:08 +0000 |
| commit | 2faa3acb4bb55f1830d517473c4bfb1616f92726 (patch) | |
| tree | 0d39b2c702f6cc6e5cb898f6c07cceb0116beb27 /django/db/models/options.py | |
| parent | d9aaad4e36ba2ebba13fd1c36da9eced4f7688ad (diff) | |
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
Diffstat (limited to 'django/db/models/options.py')
| -rw-r--r-- | django/db/models/options.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py index 01a13b4ac3..f9cfeb0f04 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -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 |
