Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
0ce945a6
Kaydet (Commit)
0ce945a6
authored
Ock 01, 2014
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #21018 -- Reversed precedence order for management commands.
üst
f17d0027
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
50 additions
and
2 deletions
+50
-2
__init__.py
django/core/management/__init__.py
+1
-1
settings.txt
docs/ref/settings.txt
+4
-0
1.7.txt
docs/releases/1.7.txt
+12
-0
__init__.py
tests/admin_scripts/complex_app/management/__init__.py
+0
-0
__init__.py
...admin_scripts/complex_app/management/commands/__init__.py
+0
-0
duplicate.py
...dmin_scripts/complex_app/management/commands/duplicate.py
+7
-0
__init__.py
tests/admin_scripts/simple_app/management/__init__.py
+0
-0
__init__.py
.../admin_scripts/simple_app/management/commands/__init__.py
+0
-0
duplicate.py
...admin_scripts/simple_app/management/commands/duplicate.py
+7
-0
tests.py
tests/admin_scripts/tests.py
+19
-1
No files found.
django/core/management/__init__.py
Dosyayı görüntüle @
0ce945a6
...
@@ -120,7 +120,7 @@ def get_commands():
...
@@ -120,7 +120,7 @@ def get_commands():
# a settings module.
# a settings module.
django
.
setup
()
django
.
setup
()
app_configs
=
apps
.
get_app_configs
()
app_configs
=
apps
.
get_app_configs
()
app_names
=
[
app_config
.
name
for
app_config
in
app_configs
]
app_names
=
[
app_config
.
name
for
app_config
in
reversed
(
app_configs
)
]
# Find and load the management module for each installed app.
# Find and load the management module for each installed app.
for
app_name
in
app_names
:
for
app_name
in
app_names
:
...
...
docs/ref/settings.txt
Dosyayı görüntüle @
0ce945a6
...
@@ -1319,6 +1319,10 @@ Django installation. Each string should be a dotted Python path to:
...
@@ -1319,6 +1319,10 @@ Django installation. Each string should be a dotted Python path to:
These rules apply regardless of whether :setting:`INSTALLED_APPS`
These rules apply regardless of whether :setting:`INSTALLED_APPS`
references application configuration classes on application packages.
references application configuration classes on application packages.
When several applications provide different versions of the same resource
(template, static file, management command, translation), the application
listed first in :setting:`INSTALLED_APPS` has precedence.
.. setting:: INTERNAL_IPS
.. setting:: INTERNAL_IPS
INTERNAL_IPS
INTERNAL_IPS
...
...
docs/releases/1.7.txt
Dosyayı görüntüle @
0ce945a6
...
@@ -697,6 +697,18 @@ following changes that take effect immediately:
...
@@ -697,6 +697,18 @@ following changes that take effect immediately:
* The ``only_installed`` argument of ``get_model`` and ``get_models`` no
* The ``only_installed`` argument of ``get_model`` and ``get_models`` no
longer exists, nor does the ``seed_cache`` argument of ``get_model``.
longer exists, nor does the ``seed_cache`` argument of ``get_model``.
Management commands and order of :setting:`INSTALLED_APPS`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When several applications provide management commands with the same name,
Django loads the command from the application that comes first in
:setting:`INSTALLED_APPS`. Previous versions loaded the command from the
applicatino that came last.
This brings discovery of management commands in line with other parts of
Django that rely on the order of :setting:`INSTALLED_APPS`, such as static
files, templates, and translations.
Behavior of ``LocMemCache`` regarding pickle errors
Behavior of ``LocMemCache`` regarding pickle errors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
tests/admin_scripts/complex_app/management/__init__.py
0 → 100644
Dosyayı görüntüle @
0ce945a6
tests/admin_scripts/complex_app/management/commands/__init__.py
0 → 100644
Dosyayı görüntüle @
0ce945a6
tests/admin_scripts/complex_app/management/commands/duplicate.py
0 → 100644
Dosyayı görüntüle @
0ce945a6
from
django.core.management.base
import
NoArgsCommand
class
Command
(
NoArgsCommand
):
def
handle_noargs
(
self
,
**
options
):
self
.
stdout
.
write
(
'complex_app'
)
tests/admin_scripts/simple_app/management/__init__.py
0 → 100644
Dosyayı görüntüle @
0ce945a6
tests/admin_scripts/simple_app/management/commands/__init__.py
0 → 100644
Dosyayı görüntüle @
0ce945a6
tests/admin_scripts/simple_app/management/commands/duplicate.py
0 → 100644
Dosyayı görüntüle @
0ce945a6
from
django.core.management.base
import
NoArgsCommand
class
Command
(
NoArgsCommand
):
def
handle_noargs
(
self
,
**
options
):
self
.
stdout
.
write
(
'simple_app'
)
tests/admin_scripts/tests.py
Dosyayı görüntüle @
0ce945a6
...
@@ -25,7 +25,7 @@ from django.test.utils import str_prefix
...
@@ -25,7 +25,7 @@ from django.test.utils import str_prefix
from
django.utils.encoding
import
force_text
from
django.utils.encoding
import
force_text
from
django.utils._os
import
upath
from
django.utils._os
import
upath
from
django.utils.six
import
StringIO
from
django.utils.six
import
StringIO
from
django.test
import
LiveServerTestCase
from
django.test
import
LiveServerTestCase
,
TestCase
test_dir
=
os
.
path
.
realpath
(
os
.
path
.
join
(
os
.
environ
[
'DJANGO_TEST_TEMP_DIR'
],
'test_project'
))
test_dir
=
os
.
path
.
realpath
(
os
.
path
.
join
(
os
.
environ
[
'DJANGO_TEST_TEMP_DIR'
],
'test_project'
))
...
@@ -1469,6 +1469,24 @@ class CommandTypes(AdminScriptTestCase):
...
@@ -1469,6 +1469,24 @@ class CommandTypes(AdminScriptTestCase):
self
.
assertOutput
(
out
,
str_prefix
(
"EXECUTE:LabelCommand label=anotherlabel, options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity',
%(_)
s'1')]"
))
self
.
assertOutput
(
out
,
str_prefix
(
"EXECUTE:LabelCommand label=anotherlabel, options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity',
%(_)
s'1')]"
))
class
Discovery
(
TestCase
):
def
test_precedence
(
self
):
"""
Apps listed first in INSTALLED_APPS have precendence.
"""
with
self
.
settings
(
INSTALLED_APPS
=
[
'admin_scripts.complex_app'
,
'admin_scripts.simple_app'
]):
out
=
StringIO
()
call_command
(
'duplicate'
,
stdout
=
out
)
self
.
assertEqual
(
out
.
getvalue
()
.
strip
(),
'complex_app'
)
with
self
.
settings
(
INSTALLED_APPS
=
[
'admin_scripts.simple_app'
,
'admin_scripts.complex_app'
]):
out
=
StringIO
()
call_command
(
'duplicate'
,
stdout
=
out
)
self
.
assertEqual
(
out
.
getvalue
()
.
strip
(),
'simple_app'
)
class
ArgumentOrder
(
AdminScriptTestCase
):
class
ArgumentOrder
(
AdminScriptTestCase
):
"""Tests for 2-stage argument parsing scheme.
"""Tests for 2-stage argument parsing scheme.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment