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
1ba0b22a
Kaydet (Commit)
1ba0b22a
authored
Nis 15, 2016
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #22936 -- Removed unused code in Field.get_db_prep_lookup().
üst
b454e2cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
20 deletions
+2
-20
__init__.py
django/db/models/fields/__init__.py
+2
-20
No files found.
django/db/models/fields/__init__.py
Dosyayı görüntüle @
1ba0b22a
...
@@ -20,7 +20,7 @@ from django.core import checks, exceptions, validators
...
@@ -20,7 +20,7 @@ from django.core import checks, exceptions, validators
# purposes.
# purposes.
from
django.core.exceptions
import
FieldDoesNotExist
# NOQA
from
django.core.exceptions
import
FieldDoesNotExist
# NOQA
from
django.db
import
connection
,
connections
,
router
from
django.db
import
connection
,
connections
,
router
from
django.db.models.query_utils
import
QueryWrapper
,
RegisterLookupMixin
from
django.db.models.query_utils
import
RegisterLookupMixin
from
django.utils
import
six
,
timezone
from
django.utils
import
six
,
timezone
from
django.utils.datastructures
import
DictWrapper
from
django.utils.datastructures
import
DictWrapper
from
django.utils.dateparse
import
(
from
django.utils.dateparse
import
(
...
@@ -780,31 +780,13 @@ class Field(RegisterLookupMixin):
...
@@ -780,31 +780,13 @@ class Field(RegisterLookupMixin):
if
not
prepared
:
if
not
prepared
:
value
=
self
.
get_prep_lookup
(
lookup_type
,
value
)
value
=
self
.
get_prep_lookup
(
lookup_type
,
value
)
prepared
=
True
prepared
=
True
if
hasattr
(
value
,
'get_compiler'
):
value
=
value
.
get_compiler
(
connection
=
connection
)
if
hasattr
(
value
,
'as_sql'
)
or
hasattr
(
value
,
'_as_sql'
):
# If the value has a relabeled_clone method it means the
# value will be handled later on.
if
hasattr
(
value
,
'relabeled_clone'
):
return
value
if
hasattr
(
value
,
'as_sql'
):
sql
,
params
=
value
.
as_sql
()
else
:
sql
,
params
=
value
.
_as_sql
(
connection
=
connection
)
return
QueryWrapper
((
'(
%
s)'
%
sql
),
params
)
if
lookup_type
in
(
'search'
,
'regex'
,
'iregex'
,
'contains'
,
if
lookup_type
in
(
'exact'
,
'gt'
,
'gte'
,
'lt'
,
'lte'
):
'icontains'
,
'iexact'
,
'startswith'
,
'endswith'
,
'istartswith'
,
'iendswith'
):
return
[
value
]
elif
lookup_type
in
(
'exact'
,
'gt'
,
'gte'
,
'lt'
,
'lte'
):
return
[
self
.
get_db_prep_value
(
value
,
connection
=
connection
,
return
[
self
.
get_db_prep_value
(
value
,
connection
=
connection
,
prepared
=
prepared
)]
prepared
=
prepared
)]
elif
lookup_type
in
(
'range'
,
'in'
):
elif
lookup_type
in
(
'range'
,
'in'
):
return
[
self
.
get_db_prep_value
(
v
,
connection
=
connection
,
return
[
self
.
get_db_prep_value
(
v
,
connection
=
connection
,
prepared
=
prepared
)
for
v
in
value
]
prepared
=
prepared
)
for
v
in
value
]
elif
lookup_type
==
'isnull'
:
return
[]
else
:
else
:
return
[
value
]
return
[
value
]
...
...
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