diff options
| author | lyova24 <lengthylyova@gmail.com> | 2025-10-05 04:28:46 +0700 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2025-10-13 17:34:14 -0400 |
| commit | 50d31aeb4993cc5f221cb5addad1d5a6e664a092 (patch) | |
| tree | 4591d82ec1463652cd8ec5e0240dd7037d4fcf76 | |
| parent | 12e3aa452a3cd190a802486100cbe9a114cc065c (diff) | |
[6.0.x] Cautioned against multi-level relative imports in coding style docs.
Backport of a545eb0c1ad5dcbb4e4cf22ce6cf486224c0ba8a from main.
| -rw-r--r-- | docs/internals/contributing/writing-code/coding-style.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/internals/contributing/writing-code/coding-style.txt b/docs/internals/contributing/writing-code/coding-style.txt index e016543ac6..72429492cd 100644 --- a/docs/internals/contributing/writing-code/coding-style.txt +++ b/docs/internals/contributing/writing-code/coding-style.txt @@ -150,8 +150,9 @@ Imports other Django components, local Django component, try/excepts. Sort lines in each group alphabetically by the full module name. Place all ``import module`` statements before ``from module import objects`` in each - section. Use absolute imports for other Django components and relative - imports for local components. + section. Use absolute imports for other Django components and a one-dot + relative import (``from .foo import Bar``) for local components. Avoid + multi-dot relative imports. * On each line, alphabetize the items with the upper case items grouped before the lowercase items. |
