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
fc9eec7b
Kaydet (Commit)
fc9eec7b
authored
Ara 20, 2017
tarafından
Mariusz Felisiak
Kaydeden (comit)
Tim Graham
Ara 20, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28934 -- Prevented Cast from truncating microseconds on Oracle.
üst
a7a36bb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
base.py
django/db/backends/oracle/base.py
+2
-0
test_cast.py
tests/db_functions/test_cast.py
+1
-4
No files found.
django/db/backends/oracle/base.py
Dosyayı görüntüle @
fc9eec7b
...
@@ -350,6 +350,8 @@ class OracleParam:
...
@@ -350,6 +350,8 @@ class OracleParam:
elif
string_size
>
4000
:
elif
string_size
>
4000
:
# Mark any string param greater than 4000 characters as a CLOB.
# Mark any string param greater than 4000 characters as a CLOB.
self
.
input_size
=
Database
.
CLOB
self
.
input_size
=
Database
.
CLOB
elif
isinstance
(
param
,
datetime
.
datetime
):
self
.
input_size
=
Database
.
TIMESTAMP
else
:
else
:
self
.
input_size
=
None
self
.
input_size
=
None
...
...
tests/db_functions/test_cast.py
Dosyayı görüntüle @
fc9eec7b
import
datetime
import
datetime
from
django.db
import
connection
,
models
from
django.db
import
models
from
django.db.models.expressions
import
Value
from
django.db.models.expressions
import
Value
from
django.db.models.functions
import
Cast
from
django.db.models.functions
import
Cast
from
django.test
import
TestCase
,
ignore_warnings
,
skipUnlessDBFeature
from
django.test
import
TestCase
,
ignore_warnings
,
skipUnlessDBFeature
...
@@ -51,9 +51,6 @@ class CastTests(TestCase):
...
@@ -51,9 +51,6 @@ class CastTests(TestCase):
def
test_cast_from_python_to_datetime
(
self
):
def
test_cast_from_python_to_datetime
(
self
):
now
=
datetime
.
datetime
.
now
()
now
=
datetime
.
datetime
.
now
()
if
connection
.
vendor
==
'oracle'
:
# Workaround until #28934 is fixed.
now
=
now
.
replace
(
microsecond
=
0
)
dates
=
Author
.
objects
.
annotate
(
cast_datetime
=
Cast
(
now
,
models
.
DateTimeField
()))
dates
=
Author
.
objects
.
annotate
(
cast_datetime
=
Cast
(
now
,
models
.
DateTimeField
()))
self
.
assertEqual
(
dates
.
get
()
.
cast_datetime
,
now
)
self
.
assertEqual
(
dates
.
get
()
.
cast_datetime
,
now
)
...
...
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