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
8863c475
Kaydet (Commit)
8863c475
authored
Şub 08, 2017
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #27821 -- Clarified docs of the return value of Form.clean_<fieldname>().
Thanks Christian Ullrich for the report and review.
üst
b27166b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
validation.txt
docs/ref/forms/validation.txt
+5
-4
No files found.
docs/ref/forms/validation.txt
Dosyayı görüntüle @
8863c475
...
...
@@ -69,8 +69,9 @@ overridden:
formfield-specific piece of validation and, possibly,
cleaning/normalizing the data.
This method should return the cleaned value obtained from ``cleaned_data``,
regardless of whether it changed anything or not.
The return value of this method replaces the existing value in
``cleaned_data``, so it must be the field's value from ``cleaned_data`` (even
if this method didn't change it) or a new cleaned value.
* The form subclass's ``clean()`` method can perform validation that requires
access to multiple form fields. This is where you might put in checks such as
...
...
@@ -315,8 +316,8 @@ write a cleaning method that operates on the ``recipients`` field, like so::
if "fred@example.com" not in data:
raise forms.ValidationError("You have forgotten about Fred!")
# Always return
the cleaned data, whether you have changed it or
#
no
t.
# Always return
a value to use as the new cleaned data, even if
#
this method didn't change i
t.
return data
.. _validating-fields-with-clean:
...
...
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