[IMP] Use explicitly relative imports in backend doc

closes #3336

Implicit relative imports have been removed in Python 3, and developers
should be encouraged to use explicitly relative imports to avoid
confusion between local and global modules

See https://www.python.org/dev/peps/pep-0328 for PEP on the subject with
reasonings and justifications
This commit is contained in:
moylop260 2014-10-27 17:45:03 -06:00 committed by Xavier Morel
parent 0baa13232c
commit 8351c6c5ed
4 changed files with 10 additions and 10 deletions

View File

@ -108,7 +108,7 @@ files in the module.
For instance, if the module has a single ``mymodule.py`` file ``__init__.py``
might contain::
import mymodule
from . import mymodule
Fortunately, there is a mechanism to help you set up an module. The command
``odoo.py`` has a subcommand :ref:`scaffold <reference/cmdline/scaffold>` to

View File

@ -46,8 +46,8 @@ Index: addons/openacademy/__init__.py
+++ addons/openacademy/__init__.py 2014-08-26 17:25:49.791783523 +0200
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+import controllers
+import models
+from . import controllers
+from . import models
Index: addons/openacademy/controllers.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000

View File

@ -7,9 +7,9 @@ Index: addons/openacademy/__init__.py
+++ addons/openacademy/__init__.py 2014-08-26 17:26:01.219783354 +0200
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import controllers
import models
+import partner
from . import controllers
from . import models
+from . import partner
Index: addons/openacademy/__openerp__.py
===================================================================
--- addons.orig/openacademy/__openerp__.py 2014-08-26 17:26:01.227783353 +0200

View File

@ -3,10 +3,10 @@ Index: addons/openacademy/__init__.py
--- addons.orig/openacademy/__init__.py 2014-08-27 14:19:23.023111330 +0200
+++ addons/openacademy/__init__.py 2014-08-27 14:22:25.043108628 +0200
@@ -2,3 +2,4 @@
import controllers
import models
import partner
+import wizard
from . import controllers
from . import models
from . import partner
+from . import wizard
Index: addons/openacademy/wizard.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000