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
be68c0bf
Kaydet (Commit)
be68c0bf
authored
Mar 22, 2017
tarafından
John D'Ambrosio
Kaydeden (comit)
Tim Graham
Haz 13, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28071 -- Fixed {% extends %} origin history.
üst
08bda82c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
AUTHORS
AUTHORS
+1
-0
loader_tags.py
django/template/loader_tags.py
+1
-1
test_extends.py
tests/template_tests/test_extends.py
+21
-0
No files found.
AUTHORS
Dosyayı görüntüle @
be68c0bf
...
...
@@ -390,6 +390,7 @@ answer newbie questions, and generally made Django that much better:
Johann Queuniet <johann.queuniet@adh.naellia.eu>
john@calixto.net
John D'Agostino <john.dagostino@gmail.com>
John D'Ambrosio <dambrosioj@gmail.com>
John Huddleston <huddlej@wwu.edu>
John Moses <moses.john.r@gmail.com>
John Paulett <john@paulett.org>
...
...
django/template/loader_tags.py
Dosyayı görüntüle @
be68c0bf
...
...
@@ -103,7 +103,7 @@ class ExtendsNode(Node):
without extending the same template twice.
"""
history
=
context
.
render_context
.
setdefault
(
self
.
context_key
,
[
context
.
template
.
origin
],
self
.
context_key
,
[
self
.
origin
],
)
template
,
origin
=
context
.
template
.
engine
.
find_template
(
template_name
,
skip
=
history
,
...
...
tests/template_tests/test_extends.py
Dosyayı görüntüle @
be68c0bf
...
...
@@ -117,3 +117,24 @@ class ExtendsBehaviorTests(SimpleTestCase):
template
=
engine
.
get_template
(
'base.html'
)
output
=
template
.
render
(
Context
({}))
self
.
assertEqual
(
output
.
strip
(),
'loader2 loader1'
)
def
test_block_override_in_extended_included_template
(
self
):
"""
ExtendsNode.find_template() initializes history with self.origin
(#28071).
"""
engine
=
Engine
(
loaders
=
[
[
'django.template.loaders.locmem.Loader'
,
{
'base.html'
:
"{
%
extends 'base.html'
%
}{
%
block base
%
}{{ block.super }}2{
%
endblock
%
}"
,
'included.html'
:
"{
%
extends 'included.html'
%
}{
%
block included
%
}{{ block.super }}B{
%
endblock
%
}"
,
}],
[
'django.template.loaders.locmem.Loader'
,
{
'base.html'
:
"{
%
block base
%
}1{
%
endblock
%
}{
%
include 'included.html'
%
}"
,
'included.html'
:
"{
%
block included
%
}A{
%
endblock
%
}"
,
}],
],
)
template
=
engine
.
get_template
(
'base.html'
)
self
.
assertEqual
(
template
.
render
(
Context
({})),
'12AB'
)
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