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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user