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
fc79c3fb
Kaydet (Commit)
fc79c3fb
authored
Mar 12, 2014
tarafından
Shai Berger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Flake8 corrections
üst
d181384e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
compiler.py
django/db/models/sql/compiler.py
+3
-4
test_relative_fields.py
tests/invalid_models_tests/test_relative_fields.py
+0
-1
models.py
tests/model_fields/models.py
+1
-0
No files found.
django/db/models/sql/compiler.py
Dosyayı görüntüle @
fc79c3fb
...
@@ -956,10 +956,9 @@ class SQLUpdateCompiler(SQLCompiler):
...
@@ -956,10 +956,9 @@ class SQLUpdateCompiler(SQLCompiler):
val
=
val
.
prepare_database_save
(
field
)
val
=
val
.
prepare_database_save
(
field
)
else
:
else
:
raise
TypeError
(
"Database is trying to update a relational field "
raise
TypeError
(
"Database is trying to update a relational field "
"of type
%
s with a value of type
%
s. Make sure "
"of type
%
s with a value of type
%
s. Make sure "
"you are setting the correct relations"
%
"you are setting the correct relations"
%
(
field
.
__class__
.
__name__
,
(
field
.
__class__
.
__name__
,
val
.
__class__
.
__name__
))
val
.
__class__
.
__name__
))
else
:
else
:
val
=
field
.
get_db_prep_save
(
val
,
connection
=
self
.
connection
)
val
=
field
.
get_db_prep_save
(
val
,
connection
=
self
.
connection
)
...
...
tests/invalid_models_tests/test_relative_fields.py
Dosyayı görüntüle @
fc79c3fb
...
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
...
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
from
django.core.checks
import
Error
from
django.core.checks
import
Error
from
django.db
import
models
from
django.db
import
models
from
django.db.models.fields
import
FieldDoesNotExist
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
django.test.testcases
import
skipIfDBFeature
from
django.test.testcases
import
skipIfDBFeature
...
...
tests/model_fields/models.py
Dosyayı görüntüle @
fc79c3fb
...
@@ -48,6 +48,7 @@ class Whiz(models.Model):
...
@@ -48,6 +48,7 @@ class Whiz(models.Model):
class
BigD
(
models
.
Model
):
class
BigD
(
models
.
Model
):
d
=
models
.
DecimalField
(
max_digits
=
38
,
decimal_places
=
30
)
d
=
models
.
DecimalField
(
max_digits
=
38
,
decimal_places
=
30
)
class
FloatModel
(
models
.
Model
):
class
FloatModel
(
models
.
Model
):
size
=
models
.
FloatField
()
size
=
models
.
FloatField
()
...
...
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