From c131949e3ebd3b54ee6d4c11239401a215e5cb9b Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Wed, 13 Sep 2023 15:35:01 +0100 Subject: Refs #34822 -- Added tests for serializing decorated functions in migrations. Functions decorated with a decorator that is properly wrapped, e.g. by using `@functools.wraps`, are already supported. --- docs/topics/migrations.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/topics/migrations.txt b/docs/topics/migrations.txt index 2ee7e53f47..08d458fbb8 100644 --- a/docs/topics/migrations.txt +++ b/docs/topics/migrations.txt @@ -783,7 +783,12 @@ Django can serialize the following: - ``LazyObject`` instances which wrap a serializable value. - Enumeration types (e.g. ``TextChoices`` or ``IntegerChoices``) instances. - Any Django field -- Any function or method reference (e.g. ``datetime.datetime.today``) (must be in module's top-level scope) +- Any function or method reference (e.g. ``datetime.datetime.today``) (must be + in module's top-level scope) + + - Functions may be decorated if wrapped properly, i.e. using + :func:`functools.wraps` + - Unbound methods used from within the class body - Any class reference (must be in module's top-level scope) - Anything with a custom ``deconstruct()`` method (:ref:`see below `) -- cgit v1.3