Loading django/contrib/postgres/fields/array.py +0 −8 Original line number Diff line number Diff line Loading @@ -96,14 +96,6 @@ class ArrayField(Field): value = [self.base_field.to_python(val) for val in vals] return value def get_default(self): """Overridden from the default to prevent string-mangling.""" if self.has_default(): if callable(self.default): return self.default() return self.default return None def value_to_string(self, obj): values = [] vals = self._get_val_from_obj(obj) Loading django/db/models/fields/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -722,7 +722,7 @@ class Field(RegisterLookupMixin): if self.has_default(): if callable(self.default): return self.default() return force_text(self.default, strings_only=True) return self.default if (not self.empty_strings_allowed or (self.null and not connection.features.interprets_empty_strings_as_nulls)): return None Loading docs/releases/1.8.txt +5 −0 Original line number Diff line number Diff line Loading @@ -857,6 +857,11 @@ Miscellaneous :exc:`~django.test.client.RedirectCycleError` if it detects a loop or hits a maximum redirect limit (rather than passing silently). * Translatable strings set as the ``default`` parameter of the field are cast to concrete strings later, so the return type of ``Field.get_default()`` is different in some cases. There is no change to default values which are the result of a callable. .. _deprecated-features-1.8: Features deprecated in 1.8 Loading Loading
django/contrib/postgres/fields/array.py +0 −8 Original line number Diff line number Diff line Loading @@ -96,14 +96,6 @@ class ArrayField(Field): value = [self.base_field.to_python(val) for val in vals] return value def get_default(self): """Overridden from the default to prevent string-mangling.""" if self.has_default(): if callable(self.default): return self.default() return self.default return None def value_to_string(self, obj): values = [] vals = self._get_val_from_obj(obj) Loading
django/db/models/fields/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -722,7 +722,7 @@ class Field(RegisterLookupMixin): if self.has_default(): if callable(self.default): return self.default() return force_text(self.default, strings_only=True) return self.default if (not self.empty_strings_allowed or (self.null and not connection.features.interprets_empty_strings_as_nulls)): return None Loading
docs/releases/1.8.txt +5 −0 Original line number Diff line number Diff line Loading @@ -857,6 +857,11 @@ Miscellaneous :exc:`~django.test.client.RedirectCycleError` if it detects a loop or hits a maximum redirect limit (rather than passing silently). * Translatable strings set as the ``default`` parameter of the field are cast to concrete strings later, so the return type of ``Field.get_default()`` is different in some cases. There is no change to default values which are the result of a callable. .. _deprecated-features-1.8: Features deprecated in 1.8 Loading