From a545eb0c1ad5dcbb4e4cf22ce6cf486224c0ba8a Mon Sep 17 00:00:00 2001 From: lyova24 Date: Sun, 5 Oct 2025 04:28:46 +0700 Subject: [PATCH] Cautioned against multi-level relative imports in coding style docs. --- docs/internals/contributing/writing-code/coding-style.txt | 5 +++-- 1 file 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.