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
3dcc3516
Kaydet (Commit)
3dcc3516
authored
8 years ago
tarafından
Vytis Banaitis
Kaydeden (comit)
Tim Graham
8 years ago
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #23919 -- Used yield from.
üst
4cffa9a1
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
24 additions
and
51 deletions
+24
-51
mutable_list.py
django/contrib/gis/geos/mutable_list.py
+1
-2
storage.py
django/contrib/staticfiles/storage.py
+1
-3
utils.py
django/contrib/staticfiles/utils.py
+1
-2
dumpdata.py
django/core/management/commands/dumpdata.py
+1
-2
json.py
django/core/serializers/json.py
+1
-2
pyyaml.py
django/core/serializers/pyyaml.py
+1
-2
creation.py
django/db/backends/base/creation.py
+1
-2
utils.py
django/db/backends/utils.py
+1
-2
expressions.py
django/db/models/expressions.py
+1
-2
fields.py
django/forms/fields.py
+1
-2
widgets.py
django/forms/widgets.py
+2
-4
base.py
django/template/base.py
+1
-2
context.py
django/template/context.py
+2
-4
defaulttags.py
django/template/defaulttags.py
+3
-6
cached.py
django/template/loaders/cached.py
+1
-2
client.py
django/test/client.py
+1
-2
models.py
tests/model_forms/models.py
+1
-2
tests.py
tests/queries/tests.py
+1
-2
test_unordered_list.py
tests/template_tests/filter_tests/test_unordered_list.py
+2
-6
No files found.
django/contrib/gis/geos/mutable_list.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -312,8 +312,7 @@ class ListMixin:
def
newItems
():
for
i
in
range
(
origLen
+
1
):
if
i
==
start
:
for
val
in
valueList
:
yield
val
yield
from
valueList
if
i
<
origLen
:
if
i
<
start
or
i
>=
stop
:
...
...
This diff is collapsed.
Click to expand it.
django/contrib/staticfiles/storage.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -402,9 +402,7 @@ class ManifestFilesMixin(HashedFilesMixin):
def
post_process
(
self
,
*
args
,
**
kwargs
):
self
.
hashed_files
=
OrderedDict
()
all_post_processed
=
super
()
.
post_process
(
*
args
,
**
kwargs
)
for
post_processed
in
all_post_processed
:
yield
post_processed
yield
from
super
()
.
post_process
(
*
args
,
**
kwargs
)
self
.
save_manifest
()
def
save_manifest
(
self
):
...
...
This diff is collapsed.
Click to expand it.
django/contrib/staticfiles/utils.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -37,8 +37,7 @@ def get_files(storage, ignore_patterns=None, location=''):
continue
if
location
:
dir
=
os
.
path
.
join
(
location
,
dir
)
for
fn
in
get_files
(
storage
,
ignore_patterns
,
dir
):
yield
fn
yield
from
get_files
(
storage
,
ignore_patterns
,
dir
)
def
check_settings
(
base_url
=
None
):
...
...
This diff is collapsed.
Click to expand it.
django/core/management/commands/dumpdata.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -166,8 +166,7 @@ class Command(BaseCommand):
if
count_only
:
yield
queryset
.
order_by
()
.
count
()
else
:
for
obj
in
queryset
.
iterator
():
yield
obj
yield
from
queryset
.
iterator
()
try
:
self
.
stdout
.
ending
=
None
...
...
This diff is collapsed.
Click to expand it.
django/core/serializers/json.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -69,8 +69,7 @@ def Deserializer(stream_or_string, **options):
stream_or_string
=
stream_or_string
.
decode
()
try
:
objects
=
json
.
loads
(
stream_or_string
)
for
obj
in
PythonDeserializer
(
objects
,
**
options
):
yield
obj
yield
from
PythonDeserializer
(
objects
,
**
options
)
except
(
GeneratorExit
,
DeserializationError
):
raise
except
Exception
as
exc
:
...
...
This diff is collapsed.
Click to expand it.
django/core/serializers/pyyaml.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -70,8 +70,7 @@ def Deserializer(stream_or_string, **options):
else
:
stream
=
stream_or_string
try
:
for
obj
in
PythonDeserializer
(
yaml
.
load
(
stream
,
Loader
=
SafeLoader
),
**
options
):
yield
obj
yield
from
PythonDeserializer
(
yaml
.
load
(
stream
,
Loader
=
SafeLoader
),
**
options
)
except
(
GeneratorExit
,
DeserializationError
):
raise
except
Exception
as
exc
:
...
...
This diff is collapsed.
Click to expand it.
django/db/backends/base/creation.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -113,8 +113,7 @@ class BaseDatabaseCreation:
if
(
model
.
_meta
.
can_migrate
(
self
.
connection
)
and
router
.
allow_migrate_model
(
self
.
connection
.
alias
,
model
)):
queryset
=
model
.
_default_manager
.
using
(
self
.
connection
.
alias
)
.
order_by
(
model
.
_meta
.
pk
.
name
)
for
obj
in
queryset
.
iterator
():
yield
obj
yield
from
queryset
.
iterator
()
# Serialize to a string
out
=
StringIO
()
serializers
.
serialize
(
"json"
,
get_objects
(),
indent
=
None
,
stream
=
out
)
...
...
This diff is collapsed.
Click to expand it.
django/db/backends/utils.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -28,8 +28,7 @@ class CursorWrapper:
def
__iter__
(
self
):
with
self
.
db
.
wrap_database_errors
:
for
item
in
self
.
cursor
:
yield
item
yield
from
self
.
cursor
def
__enter__
(
self
):
return
self
...
...
This diff is collapsed.
Click to expand it.
django/db/models/expressions.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -337,8 +337,7 @@ class BaseExpression:
yield
self
for
expr
in
self
.
get_source_expressions
():
if
expr
:
for
inner_expr
in
expr
.
flatten
():
yield
inner_expr
yield
from
expr
.
flatten
()
class
Expression
(
BaseExpression
,
Combinable
):
...
...
This diff is collapsed.
Click to expand it.
django/forms/fields.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -742,8 +742,7 @@ class CallableChoiceIterator:
self
.
choices_func
=
choices_func
def
__iter__
(
self
):
for
e
in
self
.
choices_func
():
yield
e
yield
from
self
.
choices_func
()
class
ChoiceField
(
Field
):
...
...
This diff is collapsed.
Click to expand it.
django/forms/widgets.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -539,14 +539,12 @@ class ChoiceWidget(Widget):
options from a BoundField for choice widgets.
"""
value
=
self
.
format_value
(
value
)
for
option
in
self
.
options
(
name
,
value
,
attrs
):
yield
option
yield
from
self
.
options
(
name
,
value
,
attrs
)
def
options
(
self
,
name
,
value
,
attrs
=
None
):
"""Yield a flat list of options for this widgets."""
for
group
in
self
.
optgroups
(
name
,
value
,
attrs
):
for
option
in
group
[
1
]:
yield
option
yield
from
group
[
1
]
def
optgroups
(
self
,
name
,
value
,
attrs
=
None
):
"""Return a list of optgroups for this widget."""
...
...
This diff is collapsed.
Click to expand it.
django/template/base.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -162,8 +162,7 @@ class Template:
def
__iter__
(
self
):
for
node
in
self
.
nodelist
:
for
subnode
in
node
:
yield
subnode
yield
from
node
def
_render
(
self
,
context
):
return
self
.
nodelist
.
render
(
context
)
...
...
This diff is collapsed.
Click to expand it.
django/template/context.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -43,8 +43,7 @@ class BaseContext:
return
repr
(
self
.
dicts
)
def
__iter__
(
self
):
for
d
in
reversed
(
self
.
dicts
):
yield
d
yield
from
reversed
(
self
.
dicts
)
def
push
(
self
,
*
args
,
**
kwargs
):
dicts
=
[]
...
...
@@ -192,8 +191,7 @@ class RenderContext(BaseContext):
template
=
None
def
__iter__
(
self
):
for
d
in
self
.
dicts
[
-
1
]:
yield
d
yield
from
self
.
dicts
[
-
1
]
def
__contains__
(
self
,
key
):
return
key
in
self
.
dicts
[
-
1
]
...
...
This diff is collapsed.
Click to expand it.
django/template/defaulttags.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -148,10 +148,8 @@ class ForNode(Node):
reversed_text
)
def
__iter__
(
self
):
for
node
in
self
.
nodelist_loop
:
yield
node
for
node
in
self
.
nodelist_empty
:
yield
node
yield
from
self
.
nodelist_loop
yield
from
self
.
nodelist_empty
def
render
(
self
,
context
):
if
'forloop'
in
context
:
...
...
@@ -297,8 +295,7 @@ class IfNode(Node):
def
__iter__
(
self
):
for
_
,
nodelist
in
self
.
conditions_nodelists
:
for
node
in
nodelist
:
yield
node
yield
from
nodelist
@property
def
nodelist
(
self
):
...
...
This diff is collapsed.
Click to expand it.
django/template/loaders/cached.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -63,8 +63,7 @@ class Loader(BaseLoader):
def
get_template_sources
(
self
,
template_name
):
for
loader
in
self
.
loaders
:
for
origin
in
loader
.
get_template_sources
(
template_name
):
yield
origin
yield
from
loader
.
get_template_sources
(
template_name
)
def
cache_key
(
self
,
template_name
,
skip
=
None
):
"""
...
...
This diff is collapsed.
Click to expand it.
django/test/client.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -83,8 +83,7 @@ class FakePayload:
def
closing_iterator_wrapper
(
iterable
,
close
):
try
:
for
item
in
iterable
:
yield
item
yield
from
iterable
finally
:
request_finished
.
disconnect
(
close_old_connections
)
close
()
# will fire request_finished
...
...
This diff is collapsed.
Click to expand it.
tests/model_forms/models.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -348,8 +348,7 @@ class Colour(models.Model):
name
=
models
.
CharField
(
max_length
=
50
)
def
__iter__
(
self
):
for
number
in
range
(
5
):
yield
number
yield
from
range
(
5
)
def
__str__
(
self
):
return
self
.
name
...
...
This diff is collapsed.
Click to expand it.
tests/queries/tests.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -787,8 +787,7 @@ class Queries1Tests(TestCase):
n_obj
=
Note
.
objects
.
all
()[
0
]
def
g
():
for
i
in
[
n_obj
.
pk
]:
yield
i
yield
n_obj
.
pk
self
.
assertQuerysetEqual
(
Note
.
objects
.
filter
(
pk__in
=
f
()),
[])
self
.
assertEqual
(
list
(
Note
.
objects
.
filter
(
pk__in
=
g
())),
[
n_obj
])
...
...
This diff is collapsed.
Click to expand it.
tests/template_tests/filter_tests/test_unordered_list.py
Dosyayı görüntüle @
3dcc3516
...
...
@@ -103,9 +103,7 @@ class FunctionTests(SimpleTestCase):
)
def
item_generator
():
yield
a
yield
b
yield
c
yield
from
(
a
,
b
,
c
)
self
.
assertEqual
(
unordered_list
(
item_generator
()),
...
...
@@ -129,9 +127,7 @@ class FunctionTests(SimpleTestCase):
)
def
item_generator
():
yield
a
yield
b
yield
c
yield
from
(
a
,
b
,
c
)
self
.
assertEqual
(
unordered_list
(
item_generator
(),
autoescape
=
False
),
...
...
This diff is collapsed.
Click to expand it.
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