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
bc4dc6e9
Kaydet (Commit)
bc4dc6e9
authored
Mar 03, 2014
tarafından
Russell Keith-Magee
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Edited model check messages for grammar and consistency.
üst
f7587b20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
fields.py
django/contrib/contenttypes/fields.py
+6
-6
base.py
django/db/models/base.py
+0
-0
tests.py
tests/contenttypes_tests/tests.py
+6
-6
test_models.py
tests/invalid_models_tests/test_models.py
+0
-0
No files found.
django/contrib/contenttypes/fields.py
Dosyayı görüntüle @
bc4dc6e9
...
...
@@ -67,7 +67,7 @@ class GenericForeignKey(six.with_metaclass(RenameGenericForeignKeyMethods)):
'Field names must not end with an underscore.'
,
hint
=
None
,
obj
=
self
,
id
=
'
contenttype
s.E001'
,
id
=
'
field
s.E001'
,
)
]
else
:
...
...
@@ -82,7 +82,7 @@ class GenericForeignKey(six.with_metaclass(RenameGenericForeignKeyMethods)):
"The GenericForeignKey object ID references the non-existent field '
%
s'."
%
self
.
fk_field
,
hint
=
None
,
obj
=
self
,
id
=
'contenttypes.E00
2
'
,
id
=
'contenttypes.E00
1
'
,
)
]
else
:
...
...
@@ -102,7 +102,7 @@ class GenericForeignKey(six.with_metaclass(RenameGenericForeignKeyMethods)):
),
hint
=
None
,
obj
=
self
,
id
=
'contenttypes.E00
3
'
,
id
=
'contenttypes.E00
2
'
,
)
]
else
:
...
...
@@ -114,7 +114,7 @@ class GenericForeignKey(six.with_metaclass(RenameGenericForeignKeyMethods)):
),
hint
=
"GenericForeignKeys must use a ForeignKey to 'contenttypes.ContentType' as the 'content_type' field."
,
obj
=
self
,
id
=
'contenttypes.E00
4
'
,
id
=
'contenttypes.E00
3
'
,
)
]
elif
field
.
rel
.
to
!=
ContentType
:
...
...
@@ -125,7 +125,7 @@ class GenericForeignKey(six.with_metaclass(RenameGenericForeignKeyMethods)):
),
hint
=
"GenericForeignKeys must use a ForeignKey to 'contenttypes.ContentType' as the 'content_type' field."
,
obj
=
self
,
id
=
'contenttypes.E00
5
'
,
id
=
'contenttypes.E00
4
'
,
)
]
else
:
...
...
@@ -282,7 +282,7 @@ class GenericRelation(ForeignObject):
return
[]
else
:
return
[
checks
.
Warning
(
checks
.
Error
(
(
"The GenericRelation defines a relation with the model "
"'
%
s.
%
s', but that model does not have a GenericForeignKey."
)
%
(
target
.
_meta
.
app_label
,
target
.
_meta
.
object_name
...
...
django/db/models/base.py
Dosyayı görüntüle @
bc4dc6e9
This diff is collapsed.
Click to expand it.
tests/contenttypes_tests/tests.py
Dosyayı görüntüle @
bc4dc6e9
...
...
@@ -109,7 +109,7 @@ class GenericForeignKeyTests(IsolatedModelsTestCase):
"The GenericForeignKey content type references the non-existent field 'TaggedItem.content_type'."
,
hint
=
None
,
obj
=
TaggedItem
.
content_object
,
id
=
'contenttypes.E00
3
'
,
id
=
'contenttypes.E00
2
'
,
)
]
self
.
assertEqual
(
errors
,
expected
)
...
...
@@ -127,7 +127,7 @@ class GenericForeignKeyTests(IsolatedModelsTestCase):
"'Model.content_type' is not a ForeignKey."
,
hint
=
"GenericForeignKeys must use a ForeignKey to 'contenttypes.ContentType' as the 'content_type' field."
,
obj
=
Model
.
content_object
,
id
=
'contenttypes.E00
4
'
,
id
=
'contenttypes.E00
3
'
,
)
]
self
.
assertEqual
(
errors
,
expected
)
...
...
@@ -145,7 +145,7 @@ class GenericForeignKeyTests(IsolatedModelsTestCase):
"'Model.content_type' is not a ForeignKey to 'contenttypes.ContentType'."
,
hint
=
"GenericForeignKeys must use a ForeignKey to 'contenttypes.ContentType' as the 'content_type' field."
,
obj
=
Model
.
content_object
,
id
=
'contenttypes.E00
5
'
,
id
=
'contenttypes.E00
4
'
,
)
]
self
.
assertEqual
(
errors
,
expected
)
...
...
@@ -162,7 +162,7 @@ class GenericForeignKeyTests(IsolatedModelsTestCase):
"The GenericForeignKey object ID references the non-existent field 'object_id'."
,
hint
=
None
,
obj
=
TaggedItem
.
content_object
,
id
=
'contenttypes.E00
2
'
,
id
=
'contenttypes.E00
1
'
,
)
]
self
.
assertEqual
(
errors
,
expected
)
...
...
@@ -180,7 +180,7 @@ class GenericForeignKeyTests(IsolatedModelsTestCase):
'Field names must not end with an underscore.'
,
hint
=
None
,
obj
=
Model
.
content_object_
,
id
=
'
contenttype
s.E001'
,
id
=
'
field
s.E001'
,
)
]
self
.
assertEqual
(
errors
,
expected
)
...
...
@@ -265,7 +265,7 @@ class GenericRelationshipTests(IsolatedModelsTestCase):
errors
=
Bookmark
.
tags
.
field
.
check
()
expected
=
[
checks
.
Warning
(
checks
.
Error
(
(
"The GenericRelation defines a relation with the model "
"'contenttypes_tests.TaggedItem', but that model does not have a "
"GenericForeignKey."
),
...
...
tests/invalid_models_tests/test_models.py
Dosyayı görüntüle @
bc4dc6e9
This diff is collapsed.
Click to expand it.
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