diff options
| author | Nick Pope <nick@nickpope.me.uk> | 2023-09-13 15:35:01 +0100 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2023-09-13 15:39:56 -0300 |
| commit | c131949e3ebd3b54ee6d4c11239401a215e5cb9b (patch) | |
| tree | 01a82adedad9f297b5d247aaad66058da470bdda /docs | |
| parent | 0e540fca13ecf3d40be374ef7be94a0357222873 (diff) | |
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.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/migrations.txt | 7 |
1 files changed, 6 insertions, 1 deletions
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 <custom-deconstruct-method>`) |
