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
f7eee04e
Kaydet (Commit)
f7eee04e
authored
Eyl 08, 2014
tarafından
Petras Zdanavičius
Kaydeden (comit)
Tim Graham
Eyl 08, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23451 -- Fixed typo in inlineformset_factory() error message.
üst
b161c01c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
models.py
django/forms/models.py
+1
-1
1.7.1.txt
docs/releases/1.7.1.txt
+3
-0
tests.py
tests/model_formsets/tests.py
+6
-0
No files found.
django/forms/models.py
Dosyayı görüntüle @
f7eee04e
...
@@ -949,7 +949,7 @@ def _get_foreign_key(parent_model, model, fk_name=None, can_fail=False):
...
@@ -949,7 +949,7 @@ def _get_foreign_key(parent_model, model, fk_name=None, can_fail=False):
(
fk
.
rel
.
to
!=
parent_model
and
(
fk
.
rel
.
to
!=
parent_model
and
fk
.
rel
.
to
not
in
parent_model
.
_meta
.
get_parent_list
()):
fk
.
rel
.
to
not
in
parent_model
.
_meta
.
get_parent_list
()):
raise
ValueError
(
raise
ValueError
(
"fk_name '
%
s' is not a ForeignKey to '
%
s.
%
'."
"fk_name '
%
s' is not a ForeignKey to '
%
s.
%
s
'."
%
(
fk_name
,
parent_model
.
_meta
.
app_label
,
parent_model
.
_meta
.
object_name
))
%
(
fk_name
,
parent_model
.
_meta
.
app_label
,
parent_model
.
_meta
.
object_name
))
elif
len
(
fks_to_parent
)
==
0
:
elif
len
(
fks_to_parent
)
==
0
:
raise
ValueError
(
raise
ValueError
(
...
...
docs/releases/1.7.1.txt
Dosyayı görüntüle @
f7eee04e
...
@@ -23,3 +23,6 @@ Bugfixes
...
@@ -23,3 +23,6 @@ Bugfixes
* The ``@deconstructible`` decorator now fails with a ``ValueError`` if the
* The ``@deconstructible`` decorator now fails with a ``ValueError`` if the
decorated object cannot automatically be imported (:ticket:`23418`).
decorated object cannot automatically be imported (:ticket:`23418`).
* Fixed a typo in an ``inlineformset_factory()`` error message that caused a
crash (:ticket:`23451`).
tests/model_formsets/tests.py
Dosyayı görüntüle @
f7eee04e
...
@@ -815,6 +815,12 @@ class ModelFormsetTest(TestCase):
...
@@ -815,6 +815,12 @@ class ModelFormsetTest(TestCase):
formset
=
AuthorBooksFormSet
(
data
,
instance
=
author
,
queryset
=
custom_qs
)
formset
=
AuthorBooksFormSet
(
data
,
instance
=
author
,
queryset
=
custom_qs
)
self
.
assertTrue
(
formset
.
is_valid
())
self
.
assertTrue
(
formset
.
is_valid
())
def
test_inline_formsets_with_wrong_fk_name
(
self
):
""" Regression for #23451 """
message
=
"fk_name 'title' is not a ForeignKey to 'model_formsets.Author'."
with
self
.
assertRaisesMessage
(
ValueError
,
message
):
inlineformset_factory
(
Author
,
Book
,
fields
=
"__all__"
,
fk_name
=
'title'
)
def
test_custom_pk
(
self
):
def
test_custom_pk
(
self
):
# We need to ensure that it is displayed
# We need to ensure that it is displayed
...
...
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