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
23bf4ad8
Kaydet (Commit)
23bf4ad8
authored
Kas 13, 2017
tarafından
Дилян Палаузов
Kaydeden (comit)
Tim Graham
Kas 14, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28795 -- Removed 'not in' checks and used dict.setdefault().
üst
a2ec1e6b
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
27 additions
and
60 deletions
+27
-60
apps.py
django/contrib/gis/apps.py
+1
-2
fields.py
django/contrib/gis/db/models/fields.py
+2
-3
source.py
django/contrib/gis/gdal/raster/source.py
+7
-20
models.py
django/db/migrations/operations/models.py
+2
-2
query.py
django/db/models/sql/query.py
+1
-2
boundfield.py
django/forms/boundfield.py
+3
-13
response.py
django/http/response.py
+1
-4
locale.py
django/middleware/locale.py
+1
-2
security.py
django/middleware/security.py
+4
-4
defaulttags.py
django/template/defaulttags.py
+1
-2
http.py
django/views/decorators/http.py
+2
-2
base.py
django/views/generic/base.py
+1
-2
runtests.py
tests/runtests.py
+1
-2
No files found.
django/contrib/gis/apps.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -8,5 +8,4 @@ class GISConfig(AppConfig):
...
@@ -8,5 +8,4 @@ class GISConfig(AppConfig):
verbose_name
=
_
(
"GIS"
)
verbose_name
=
_
(
"GIS"
)
def
ready
(
self
):
def
ready
(
self
):
if
'geojson'
not
in
serializers
.
BUILTIN_SERIALIZERS
:
serializers
.
BUILTIN_SERIALIZERS
.
setdefault
(
'geojson'
,
'django.contrib.gis.serializers.geojson'
)
serializers
.
BUILTIN_SERIALIZERS
[
'geojson'
]
=
"django.contrib.gis.serializers.geojson"
django/contrib/gis/db/models/fields.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -255,9 +255,8 @@ class GeometryField(BaseSpatialField):
...
@@ -255,9 +255,8 @@ class GeometryField(BaseSpatialField):
'srid'
:
self
.
srid
,
'srid'
:
self
.
srid
,
}
}
defaults
.
update
(
kwargs
)
defaults
.
update
(
kwargs
)
if
(
self
.
dim
>
2
and
'widget'
not
in
kwargs
and
if
self
.
dim
>
2
and
not
getattr
(
defaults
[
'form_class'
]
.
widget
,
'supports_3d'
,
False
):
not
getattr
(
defaults
[
'form_class'
]
.
widget
,
'supports_3d'
,
False
)):
defaults
.
setdefault
(
'widget'
,
forms
.
Textarea
)
defaults
[
'widget'
]
=
forms
.
Textarea
return
super
()
.
formfield
(
**
defaults
)
return
super
()
.
formfield
(
**
defaults
)
def
select_format
(
self
,
compiler
,
sql
,
params
):
def
select_format
(
self
,
compiler
,
sql
,
params
):
...
...
django/contrib/gis/gdal/raster/source.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -381,27 +381,14 @@ class GDALRaster(GDALRasterBase):
...
@@ -381,27 +381,14 @@ class GDALRaster(GDALRasterBase):
consult the GDAL_RESAMPLE_ALGORITHMS constant.
consult the GDAL_RESAMPLE_ALGORITHMS constant.
"""
"""
# Get the parameters defining the geotransform, srid, and size of the raster
# Get the parameters defining the geotransform, srid, and size of the raster
if
'width'
not
in
ds_input
:
ds_input
.
setdefault
(
'width'
,
self
.
width
)
ds_input
[
'width'
]
=
self
.
width
ds_input
.
setdefault
(
'height'
,
self
.
height
)
ds_input
.
setdefault
(
'srid'
,
self
.
srs
.
srid
)
if
'height'
not
in
ds_input
:
ds_input
.
setdefault
(
'origin'
,
self
.
origin
)
ds_input
[
'height'
]
=
self
.
height
ds_input
.
setdefault
(
'scale'
,
self
.
scale
)
ds_input
.
setdefault
(
'skew'
,
self
.
skew
)
if
'srid'
not
in
ds_input
:
ds_input
[
'srid'
]
=
self
.
srs
.
srid
if
'origin'
not
in
ds_input
:
ds_input
[
'origin'
]
=
self
.
origin
if
'scale'
not
in
ds_input
:
ds_input
[
'scale'
]
=
self
.
scale
if
'skew'
not
in
ds_input
:
ds_input
[
'skew'
]
=
self
.
skew
# Get the driver, name, and datatype of the target raster
# Get the driver, name, and datatype of the target raster
if
'driver'
not
in
ds_input
:
ds_input
.
setdefault
(
'driver'
,
self
.
driver
.
name
)
ds_input
[
'driver'
]
=
self
.
driver
.
name
if
'name'
not
in
ds_input
:
if
'name'
not
in
ds_input
:
ds_input
[
'name'
]
=
self
.
name
+
'_copy.'
+
self
.
driver
.
name
ds_input
[
'name'
]
=
self
.
name
+
'_copy.'
+
self
.
driver
.
name
...
...
django/db/migrations/operations/models.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -693,8 +693,8 @@ class AlterModelOptions(ModelOptionOperation):
...
@@ -693,8 +693,8 @@ class AlterModelOptions(ModelOptionOperation):
model_state
.
options
=
dict
(
model_state
.
options
)
model_state
.
options
=
dict
(
model_state
.
options
)
model_state
.
options
.
update
(
self
.
options
)
model_state
.
options
.
update
(
self
.
options
)
for
key
in
self
.
ALTER_OPTION_KEYS
:
for
key
in
self
.
ALTER_OPTION_KEYS
:
if
key
not
in
self
.
options
and
key
in
model_state
.
options
:
if
key
not
in
self
.
options
:
del
model_state
.
options
[
key
]
model_state
.
options
.
pop
(
key
,
False
)
state
.
reload_model
(
app_label
,
self
.
name_lower
,
delay
=
True
)
state
.
reload_model
(
app_label
,
self
.
name_lower
,
delay
=
True
)
def
database_forwards
(
self
,
app_label
,
schema_editor
,
from_state
,
to_state
):
def
database_forwards
(
self
,
app_label
,
schema_editor
,
from_state
,
to_state
):
...
...
django/db/models/sql/query.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -692,8 +692,7 @@ class Query:
...
@@ -692,8 +692,7 @@ class Query:
# in the parent list. Again, it must be mentioned to ensure that
# in the parent list. Again, it must be mentioned to ensure that
# only "must include" fields are pulled in.
# only "must include" fields are pulled in.
for
model
in
orig_opts
.
get_parent_list
():
for
model
in
orig_opts
.
get_parent_list
():
if
model
not
in
seen
:
seen
.
setdefault
(
model
,
set
())
seen
[
model
]
=
set
()
for
model
,
values
in
seen
.
items
():
for
model
,
values
in
seen
.
items
():
callback
(
target
,
model
,
values
)
callback
(
target
,
model
,
values
)
...
...
django/forms/boundfield.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -87,20 +87,10 @@ class BoundField:
...
@@ -87,20 +87,10 @@ class BoundField:
attrs
=
attrs
or
{}
attrs
=
attrs
or
{}
attrs
=
self
.
build_widget_attrs
(
attrs
,
widget
)
attrs
=
self
.
build_widget_attrs
(
attrs
,
widget
)
auto_id
=
self
.
auto_id
if
self
.
auto_id
and
'id'
not
in
widget
.
attrs
:
if
auto_id
and
'id'
not
in
attrs
and
'id'
not
in
widget
.
attrs
:
attrs
.
setdefault
(
'id'
,
self
.
html_initial_id
if
only_initial
else
self
.
auto_id
)
if
not
only_initial
:
attrs
[
'id'
]
=
auto_id
else
:
attrs
[
'id'
]
=
self
.
html_initial_id
if
not
only_initial
:
name
=
self
.
html_name
else
:
name
=
self
.
html_initial_name
return
widget
.
render
(
return
widget
.
render
(
name
=
name
,
name
=
self
.
html_initial_name
if
only_initial
else
self
.
html_
name
,
value
=
self
.
value
(),
value
=
self
.
value
(),
attrs
=
attrs
,
attrs
=
attrs
,
renderer
=
self
.
form
.
renderer
,
renderer
=
self
.
form
.
renderer
,
...
...
django/http/response.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -136,10 +136,7 @@ class HttpResponseBase:
...
@@ -136,10 +136,7 @@ class HttpResponseBase:
self
.
_headers
[
header
.
lower
()]
=
(
header
,
value
)
self
.
_headers
[
header
.
lower
()]
=
(
header
,
value
)
def
__delitem__
(
self
,
header
):
def
__delitem__
(
self
,
header
):
try
:
self
.
_headers
.
pop
(
header
.
lower
(),
False
)
del
self
.
_headers
[
header
.
lower
()]
except
KeyError
:
pass
def
__getitem__
(
self
,
header
):
def
__getitem__
(
self
,
header
):
return
self
.
_headers
[
header
.
lower
()][
1
]
return
self
.
_headers
[
header
.
lower
()][
1
]
...
...
django/middleware/locale.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -57,6 +57,5 @@ class LocaleMiddleware(MiddlewareMixin):
...
@@ -57,6 +57,5 @@ class LocaleMiddleware(MiddlewareMixin):
if
not
(
i18n_patterns_used
and
language_from_path
):
if
not
(
i18n_patterns_used
and
language_from_path
):
patch_vary_headers
(
response
,
(
'Accept-Language'
,))
patch_vary_headers
(
response
,
(
'Accept-Language'
,))
if
'Content-Language'
not
in
response
:
response
.
setdefault
(
'Content-Language'
,
language
)
response
[
'Content-Language'
]
=
language
return
response
return
response
django/middleware/security.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -37,10 +37,10 @@ class SecurityMiddleware(MiddlewareMixin):
...
@@ -37,10 +37,10 @@ class SecurityMiddleware(MiddlewareMixin):
sts_header
=
sts_header
+
"; preload"
sts_header
=
sts_header
+
"; preload"
response
[
"strict-transport-security"
]
=
sts_header
response
[
"strict-transport-security"
]
=
sts_header
if
self
.
content_type_nosniff
and
'x-content-type-options'
not
in
response
:
if
self
.
content_type_nosniff
:
response
[
"x-content-type-options"
]
=
"nosniff"
response
.
setdefault
(
'x-content-type-options'
,
'nosniff'
)
if
self
.
xss_filter
and
'x-xss-protection'
not
in
response
:
if
self
.
xss_filter
:
response
[
"x-xss-protection"
]
=
"1; mode=block"
response
.
setdefault
(
'x-xss-protection'
,
'1; mode=block'
)
return
response
return
response
django/template/defaulttags.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -225,8 +225,7 @@ class IfChangedNode(Node):
...
@@ -225,8 +225,7 @@ class IfChangedNode(Node):
def
render
(
self
,
context
):
def
render
(
self
,
context
):
# Init state storage
# Init state storage
state_frame
=
self
.
_get_context_stack_frame
(
context
)
state_frame
=
self
.
_get_context_stack_frame
(
context
)
if
self
not
in
state_frame
:
state_frame
.
setdefault
(
self
)
state_frame
[
self
]
=
None
nodelist_true_output
=
None
nodelist_true_output
=
None
if
self
.
_varlist
:
if
self
.
_varlist
:
...
...
django/views/decorators/http.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -103,8 +103,8 @@ def condition(etag_func=None, last_modified_func=None):
...
@@ -103,8 +103,8 @@ def condition(etag_func=None, last_modified_func=None):
if
request
.
method
in
(
'GET'
,
'HEAD'
):
if
request
.
method
in
(
'GET'
,
'HEAD'
):
if
res_last_modified
and
not
response
.
has_header
(
'Last-Modified'
):
if
res_last_modified
and
not
response
.
has_header
(
'Last-Modified'
):
response
[
'Last-Modified'
]
=
http_date
(
res_last_modified
)
response
[
'Last-Modified'
]
=
http_date
(
res_last_modified
)
if
res_etag
and
not
response
.
has_header
(
'ETag'
)
:
if
res_etag
:
response
[
'ETag'
]
=
res_etag
response
.
setdefault
(
'ETag'
,
res_etag
)
return
response
return
response
...
...
django/views/generic/base.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -21,8 +21,7 @@ class ContextMixin:
...
@@ -21,8 +21,7 @@ class ContextMixin:
extra_context
=
None
extra_context
=
None
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
if
'view'
not
in
kwargs
:
kwargs
.
setdefault
(
'view'
,
self
)
kwargs
[
'view'
]
=
self
if
self
.
extra_context
is
not
None
:
if
self
.
extra_context
is
not
None
:
kwargs
.
update
(
self
.
extra_context
)
kwargs
.
update
(
self
.
extra_context
)
return
kwargs
return
kwargs
...
...
tests/runtests.py
Dosyayı görüntüle @
23bf4ad8
...
@@ -455,8 +455,7 @@ if __name__ == "__main__":
...
@@ -455,8 +455,7 @@ if __name__ == "__main__":
if
options
.
settings
:
if
options
.
settings
:
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
=
options
.
settings
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
=
options
.
settings
else
:
else
:
if
"DJANGO_SETTINGS_MODULE"
not
in
os
.
environ
:
os
.
environ
.
setdefault
(
'DJANGO_SETTINGS_MODULE'
,
'test_sqlite'
)
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
=
'test_sqlite'
options
.
settings
=
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
options
.
settings
=
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
if
options
.
selenium
:
if
options
.
selenium
:
...
...
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