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
3ac823fc
Kaydet (Commit)
3ac823fc
authored
Kas 19, 2013
tarafından
Pablo Martín
Kaydeden (comit)
Claude Paroz
Kas 22, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #21460 -- Reenabled proper template precedence in find_template
Refs #20806. Thanks Unai Zalakain for the review.
üst
d6cc37d6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
0 deletions
+34
-0
AUTHORS
AUTHORS
+1
-0
cached.py
django/template/loaders/cached.py
+1
-0
foo.html
tests/template_tests/templates/priority/foo.html
+1
-0
test_loaders.py
tests/template_tests/test_loaders.py
+30
-0
foo.html
tests/templates/priority/foo.html
+1
-0
No files found.
AUTHORS
Dosyayı görüntüle @
3ac823fc
...
...
@@ -420,6 +420,7 @@ answer newbie questions, and generally made Django that much better:
mark@junklight.com
Orestis Markou <orestis@orestis.gr>
Andrés Torres Marroquín <andres.torres.marroquin@gmail.com>
Pablo Martín <goinnn@gmail.com>
Takashi Matsuo <matsuo.takashi@gmail.com>
Zlatko Mašek <zlatko.masek@gmail.com>
Yasushi Masuda <whosaysni@gmail.com>
...
...
django/template/loaders/cached.py
Dosyayı görüntüle @
3ac823fc
...
...
@@ -53,6 +53,7 @@ class Loader(BaseLoader):
pass
else
:
result
=
(
template
,
make_origin
(
display_name
,
loader
,
name
,
dirs
))
break
self
.
find_template_cache
[
key
]
=
result
if
result
:
return
result
...
...
tests/template_tests/templates/priority/foo.html
0 → 100644
Dosyayı görüntüle @
3ac823fc
no priority
tests/template_tests/test_loaders.py
Dosyayı görüntüle @
3ac823fc
...
...
@@ -189,3 +189,33 @@ class TemplateDirsOverrideTest(unittest.TestCase):
for
dirs
in
self
.
dirs_iter
:
template
=
loader
.
select_template
([
'test_dirs.html'
],
dirs
=
dirs
)
self
.
assertEqual
(
template
.
render
(
Context
({})),
'spam eggs
\n
'
)
@override_settings
(
TEMPLATE_LOADERS
=
(
(
'django.template.loaders.cached.Loader'
,
(
'django.template.loaders.filesystem.Loader'
,
'django.template.loaders.app_directories.Loader'
,
)),
)
)
class
PriorityCacheLoader
(
TestCase
):
def
test_basic
(
self
):
"""
Check that the order of template loader works. Refs #21460.
"""
t1
,
name
=
loader
.
find_template
(
'priority/foo.html'
)
self
.
assertEqual
(
t1
.
render
(
Context
({})),
'priority
\n
'
)
@override_settings
(
TEMPLATE_LOADERS
=
(
'django.template.loaders.filesystem.Loader'
,
'django.template.loaders.app_directories.Loader'
,),
)
class
PriorityLoader
(
TestCase
):
def
test_basic
(
self
):
"""
Check that the order of template loader works. Refs #21460.
"""
t1
,
name
=
loader
.
find_template
(
'priority/foo.html'
)
self
.
assertEqual
(
t1
.
render
(
Context
({})),
'priority
\n
'
)
tests/templates/priority/foo.html
0 → 100644
Dosyayı görüntüle @
3ac823fc
priority
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