1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Cautioned against multi-level relative imports in coding style docs.

This commit is contained in:
lyova24
2025-10-05 04:28:46 +07:00
committed by Jacob Walls
parent 54cfb5f328
commit a545eb0c1a

View File

@@ -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.