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
1933e56e
Kaydet (Commit)
1933e56e
authored
Şub 09, 2019
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Şub 09, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed uneeded generator expressions and list comprehensions.
üst
b1a2ad69
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
16 deletions
+16
-16
ogrinspect.py
django/contrib/gis/utils/ogrinspect.py
+1
-1
operations.py
django/db/backends/mysql/operations.py
+1
-1
forms.py
django/forms/forms.py
+1
-1
html.py
django/test/html.py
+1
-1
test_ordinary_fields.py
tests/invalid_models_tests/test_ordinary_fields.py
+2
-2
tests.py
tests/lookup/tests.py
+1
-1
tests.py
tests/mail/tests.py
+2
-2
tests.py
tests/queries/tests.py
+2
-2
test_response.py
tests/template_tests/test_response.py
+5
-5
No files found.
django/contrib/gis/utils/ogrinspect.py
Dosyayı görüntüle @
1933e56e
...
@@ -116,7 +116,7 @@ def ogrinspect(*args, **kwargs):
...
@@ -116,7 +116,7 @@ def ogrinspect(*args, **kwargs):
Note: Call the _ogrinspect() helper to do the heavy lifting.
Note: Call the _ogrinspect() helper to do the heavy lifting.
"""
"""
return
'
\n
'
.
join
(
s
for
s
in
_ogrinspect
(
*
args
,
**
kwargs
))
return
'
\n
'
.
join
(
_ogrinspect
(
*
args
,
**
kwargs
))
def
_ogrinspect
(
data_source
,
model_name
,
geom_name
=
'geom'
,
layer_key
=
0
,
srid
=
None
,
def
_ogrinspect
(
data_source
,
model_name
,
geom_name
=
'geom'
,
layer_key
=
0
,
srid
=
None
,
...
...
django/db/backends/mysql/operations.py
Dosyayı görüntüle @
1933e56e
...
@@ -107,7 +107,7 @@ class DatabaseOperations(BaseDatabaseOperations):
...
@@ -107,7 +107,7 @@ class DatabaseOperations(BaseDatabaseOperations):
except
ValueError
:
except
ValueError
:
sql
=
field_name
sql
=
field_name
else
:
else
:
format_str
=
''
.
join
(
[
f
for
f
in
format
[:
i
]]
+
[
f
for
f
in
format_def
[
i
:]
])
format_str
=
''
.
join
(
format
[:
i
]
+
format_def
[
i
:
])
sql
=
"CAST(DATE_FORMAT(
%
s, '
%
s') AS DATETIME)"
%
(
field_name
,
format_str
)
sql
=
"CAST(DATE_FORMAT(
%
s, '
%
s') AS DATETIME)"
%
(
field_name
,
format_str
)
return
sql
return
sql
...
...
django/forms/forms.py
Dosyayı görüntüle @
1933e56e
...
@@ -160,7 +160,7 @@ class BaseForm:
...
@@ -160,7 +160,7 @@ class BaseForm:
"Key '
%
s' not found in '
%
s'. Choices are:
%
s."
%
(
"Key '
%
s' not found in '
%
s'. Choices are:
%
s."
%
(
name
,
name
,
self
.
__class__
.
__name__
,
self
.
__class__
.
__name__
,
', '
.
join
(
sorted
(
f
for
f
in
self
.
fields
)),
', '
.
join
(
sorted
(
self
.
fields
)),
)
)
)
)
if
name
not
in
self
.
_bound_fields_cache
:
if
name
not
in
self
.
_bound_fields_cache
:
...
...
django/test/html.py
Dosyayı görüntüle @
1933e56e
...
@@ -72,7 +72,7 @@ class Element:
...
@@ -72,7 +72,7 @@ class Element:
return
self
.
children
==
element
.
children
return
self
.
children
==
element
.
children
def
__hash__
(
self
):
def
__hash__
(
self
):
return
hash
((
self
.
name
,
*
(
a
for
a
in
self
.
attributes
)
))
return
hash
((
self
.
name
,
*
self
.
attributes
))
def
_count
(
self
,
element
,
count
=
True
):
def
_count
(
self
,
element
,
count
=
True
):
if
not
isinstance
(
element
,
str
):
if
not
isinstance
(
element
,
str
):
...
...
tests/invalid_models_tests/test_ordinary_fields.py
Dosyayı görüntüle @
1933e56e
...
@@ -156,14 +156,14 @@ class CharFieldTests(SimpleTestCase):
...
@@ -156,14 +156,14 @@ class CharFieldTests(SimpleTestCase):
self
.
display
=
display
self
.
display
=
display
def
__iter__
(
self
):
def
__iter__
(
self
):
return
(
x
for
x
in
[
self
.
value
,
self
.
display
]
)
return
iter
((
self
.
value
,
self
.
display
)
)
def
__len__
(
self
):
def
__len__
(
self
):
return
2
return
2
class
Things
:
class
Things
:
def
__iter__
(
self
):
def
__iter__
(
self
):
return
(
x
for
x
in
[
ThingItem
(
1
,
2
),
ThingItem
(
3
,
4
)]
)
return
iter
((
ThingItem
(
1
,
2
),
ThingItem
(
3
,
4
))
)
class
ThingWithIterableChoices
(
models
.
Model
):
class
ThingWithIterableChoices
(
models
.
Model
):
thing
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
choices
=
Things
())
thing
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
choices
=
Things
())
...
...
tests/lookup/tests.py
Dosyayı görüntüle @
1933e56e
...
@@ -531,7 +531,7 @@ class LookupTests(TestCase):
...
@@ -531,7 +531,7 @@ class LookupTests(TestCase):
self
.
assertQuerysetEqual
(
Article
.
objects
.
filter
(
headline__startswith
=
'Article'
)
.
none
(),
[])
self
.
assertQuerysetEqual
(
Article
.
objects
.
filter
(
headline__startswith
=
'Article'
)
.
none
(),
[])
self
.
assertEqual
(
Article
.
objects
.
none
()
.
count
(),
0
)
self
.
assertEqual
(
Article
.
objects
.
none
()
.
count
(),
0
)
self
.
assertEqual
(
Article
.
objects
.
none
()
.
update
(
headline
=
"This should not take effect"
),
0
)
self
.
assertEqual
(
Article
.
objects
.
none
()
.
update
(
headline
=
"This should not take effect"
),
0
)
self
.
assertQuerysetEqual
(
[
article
for
article
in
Article
.
objects
.
none
()
.
iterator
()]
,
[])
self
.
assertQuerysetEqual
(
Article
.
objects
.
none
()
.
iterator
()
,
[])
def
test_in
(
self
):
def
test_in
(
self
):
# using __in with an empty list should return an empty query set
# using __in with an empty list should return an empty query set
...
...
tests/mail/tests.py
Dosyayı görüntüle @
1933e56e
...
@@ -844,8 +844,8 @@ class BaseEmailBackendTests(HeadersCheckMixin):
...
@@ -844,8 +844,8 @@ class BaseEmailBackendTests(HeadersCheckMixin):
def
test_send_many
(
self
):
def
test_send_many
(
self
):
email1
=
EmailMessage
(
'Subject'
,
'Content1'
,
'from@example.com'
,
[
'to@example.com'
])
email1
=
EmailMessage
(
'Subject'
,
'Content1'
,
'from@example.com'
,
[
'to@example.com'
])
email2
=
EmailMessage
(
'Subject'
,
'Content2'
,
'from@example.com'
,
[
'to@example.com'
])
email2
=
EmailMessage
(
'Subject'
,
'Content2'
,
'from@example.com'
,
[
'to@example.com'
])
# send_messages() may take a list or a
gen
erator.
# send_messages() may take a list or a
n it
erator.
emails_lists
=
([
email1
,
email2
],
(
email
for
email
in
[
email1
,
email2
]
))
emails_lists
=
([
email1
,
email2
],
iter
((
email1
,
email2
)
))
for
emails_list
in
emails_lists
:
for
emails_list
in
emails_lists
:
num_sent
=
mail
.
get_connection
()
.
send_messages
(
emails_list
)
num_sent
=
mail
.
get_connection
()
.
send_messages
(
emails_list
)
self
.
assertEqual
(
num_sent
,
2
)
self
.
assertEqual
(
num_sent
,
2
)
...
...
tests/queries/tests.py
Dosyayı görüntüle @
1933e56e
...
@@ -1935,9 +1935,9 @@ class RawQueriesTests(TestCase):
...
@@ -1935,9 +1935,9 @@ class RawQueriesTests(TestCase):
class
GeneratorExpressionTests
(
SimpleTestCase
):
class
GeneratorExpressionTests
(
SimpleTestCase
):
def
test_ticket10432
(
self
):
def
test_ticket10432
(
self
):
# Using an empty
generator expression
as the rvalue for an "__in"
# Using an empty
iterator
as the rvalue for an "__in"
# lookup is legal.
# lookup is legal.
self
.
assertCountEqual
(
Note
.
objects
.
filter
(
pk__in
=
(
x
for
x
in
())),
[])
self
.
assertCountEqual
(
Note
.
objects
.
filter
(
pk__in
=
iter
(
())),
[])
class
ComparisonTests
(
TestCase
):
class
ComparisonTests
(
TestCase
):
...
...
tests/template_tests/test_response.py
Dosyayı görüntüle @
1933e56e
...
@@ -77,17 +77,17 @@ class SimpleTemplateResponseTest(SimpleTestCase):
...
@@ -77,17 +77,17 @@ class SimpleTemplateResponseTest(SimpleTestCase):
self
.
assertFalse
(
response
.
is_rendered
)
self
.
assertFalse
(
response
.
is_rendered
)
def
iteration
():
def
iteration
():
for
x
in
response
:
list
(
response
)
pass
with
self
.
assertRaises
(
ContentNotRenderedError
):
msg
=
'The response content must be rendered before it can be iterated over.'
with
self
.
assertRaisesMessage
(
ContentNotRenderedError
,
msg
):
iteration
()
iteration
()
self
.
assertFalse
(
response
.
is_rendered
)
self
.
assertFalse
(
response
.
is_rendered
)
def
test_iteration_rendered
(
self
):
def
test_iteration_rendered
(
self
):
# iteration works for rendered responses
# iteration works for rendered responses
response
=
self
.
_response
()
.
render
()
response
=
self
.
_response
()
.
render
()
res
=
[
x
for
x
in
response
]
self
.
assertEqual
(
list
(
response
),
[
b
'foo'
])
self
.
assertEqual
(
res
,
[
b
'foo'
])
def
test_content_access_unrendered
(
self
):
def
test_content_access_unrendered
(
self
):
# unrendered response raises an exception when content is accessed
# unrendered response raises an exception when content is accessed
...
...
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