Skip to content

Commit a86c14e

Browse files
authored
Remove excerpt field workaround for South FakeORM (jazzband#610)
* Remove excerpt field workaround for South FakeORM South FakeORM hasn't been supported since fda2d39, but the workaround introduced in 9147bec evaded deletion. The `NoRendered` model was removed in 9df3df9, but with that model gone, the `no_excerpt_field` argument became obsolete as well. * Document removal of `no_excerpt_field` in changelog
1 parent 0fcfc11 commit a86c14e

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ To be released
1111
- Don't use `post_init` signal for initialize tracker
1212
- Make `contribute_to_class()` in `StatusField`, `MonitorField` and `SplitField`
1313
forward additional arguments to Django
14+
- `SplitField` no longer accepts `no_excerpt_field` as a keyword argument
1415

1516
4.4.0 (2024-02-10)
1617
------------------

model_utils/fields.py

+1-14
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,8 @@ def __set__(self, obj, value):
222222

223223

224224
class SplitField(models.TextField):
225-
def __init__(self, *args, no_excerpt_field=False, **kwargs):
226-
# for South FakeORM compatibility: the frozen version of a
227-
# SplitField can't try to add an _excerpt field, because the
228-
# _excerpt field itself is frozen as well. See introspection
229-
# rules below.
230-
self.add_excerpt_field = not no_excerpt_field
231-
super().__init__(*args, **kwargs)
232-
233225
def contribute_to_class(self, cls, name, *args, **kwargs):
234-
if self.add_excerpt_field and not cls._meta.abstract:
226+
if not cls._meta.abstract:
235227
excerpt_field = models.TextField(editable=False)
236228
cls.add_to_class(_excerpt_field_name(name), excerpt_field)
237229
super().contribute_to_class(cls, name, *args, **kwargs)
@@ -253,11 +245,6 @@ def get_prep_value(self, value):
253245
except AttributeError:
254246
return value
255247

256-
def deconstruct(self):
257-
name, path, args, kwargs = super().deconstruct()
258-
kwargs['no_excerpt_field'] = True
259-
return name, path, args, kwargs
260-
261248

262249
class UUIDField(models.UUIDField):
263250
"""

0 commit comments

Comments
 (0)