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
a146b656
Kaydet (Commit)
a146b656
authored
Agu 10, 2017
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Agu 10, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #28459 -- Improved performance of loading DecimalField on SQLite.
üst
bfb746f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
operations.py
django/db/backends/sqlite3/operations.py
+6
-3
No files found.
django/db/backends/sqlite3/operations.py
Dosyayı görüntüle @
a146b656
...
...
@@ -5,9 +5,9 @@ from contextlib import suppress
from
django.conf
import
settings
from
django.core.exceptions
import
FieldError
from
django.db
import
utils
from
django.db.backends
import
utils
as
backend_utils
from
django.db.backends.base.operations
import
BaseDatabaseOperations
from
django.db.models
import
aggregates
,
fields
from
django.db.models.expressions
import
Col
from
django.utils
import
timezone
from
django.utils.dateparse
import
parse_date
,
parse_datetime
,
parse_time
from
django.utils.duration
import
duration_string
...
...
@@ -206,7 +206,9 @@ class DatabaseOperations(BaseDatabaseOperations):
converters
.
append
(
self
.
convert_datefield_value
)
elif
internal_type
==
'TimeField'
:
converters
.
append
(
self
.
convert_timefield_value
)
elif
internal_type
==
'DecimalField'
:
# Converter for Col is added with Database.register_converter()
# in base.py.
elif
internal_type
==
'DecimalField'
and
not
isinstance
(
expression
,
Col
):
converters
.
append
(
self
.
convert_decimalfield_value
)
elif
internal_type
==
'UUIDField'
:
converters
.
append
(
self
.
convert_uuidfield_value
)
...
...
@@ -237,7 +239,8 @@ class DatabaseOperations(BaseDatabaseOperations):
def
convert_decimalfield_value
(
self
,
value
,
expression
,
connection
):
if
value
is
not
None
:
value
=
expression
.
output_field
.
format_number
(
value
)
value
=
backend_utils
.
typecast_decimal
(
value
)
# Value is not converted to Decimal here as it will be converted
# later in BaseExpression.convert_value().
return
value
def
convert_uuidfield_value
(
self
,
value
,
expression
,
connection
):
...
...
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