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
b9bf61ce
Kaydet (Commit)
b9bf61ce
authored
Haz 11, 2015
tarafından
Nick Smith
Kaydeden (comit)
Tim Graham
Haz 11, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Used PEP 8 style indentation in forms docs.
üst
64033fd0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
24 deletions
+31
-24
fields.txt
docs/ref/forms/fields.txt
+17
-17
validation.txt
docs/ref/forms/validation.txt
+4
-2
widgets.txt
docs/ref/forms/widgets.txt
+10
-5
No files found.
docs/ref/forms/fields.txt
Dosyayı görüntüle @
b9bf61ce
...
@@ -452,20 +452,20 @@ For each field, we describe the default widget used if you don't specify
...
@@ -452,20 +452,20 @@ For each field, we describe the default widget used if you don't specify
If no ``input_formats`` argument is provided, the default input formats are::
If no ``input_formats`` argument is provided, the default input formats are::
['%Y-%m-%d', # '2006-10-25'
['%Y-%m-%d', # '2006-10-25'
'%m/%d/%Y',
# '10/25/2006'
'%m/%d/%Y',
# '10/25/2006'
'%m/%d/%y']
# '10/25/06'
'%m/%d/%y']
# '10/25/06'
Additionally, if you specify :setting:`USE_L10N=False<USE_L10N>` in your settings, the
Additionally, if you specify :setting:`USE_L10N=False<USE_L10N>` in your settings, the
following will also be included in the default input formats::
following will also be included in the default input formats::
['%b %d %Y', # 'Oct 25 2006'
['%b %d %Y', # 'Oct 25 2006'
'%b %d, %Y',
# 'Oct 25, 2006'
'%b %d, %Y',
# 'Oct 25, 2006'
'%d %b %Y',
# '25 Oct 2006'
'%d %b %Y',
# '25 Oct 2006'
'%d %b, %Y',
# '25 Oct, 2006'
'%d %b, %Y',
# '25 Oct, 2006'
'%B %d %Y',
# 'October 25 2006'
'%B %d %Y',
# 'October 25 2006'
'%B %d, %Y',
# 'October 25, 2006'
'%B %d, %Y',
# 'October 25, 2006'
'%d %B %Y',
# '25 October 2006'
'%d %B %Y',
# '25 October 2006'
'%d %B, %Y']
# '25 October, 2006'
'%d %B, %Y']
# '25 October, 2006'
See also :ref:`format localization <format-localization>`.
See also :ref:`format localization <format-localization>`.
...
@@ -491,14 +491,14 @@ For each field, we describe the default widget used if you don't specify
...
@@ -491,14 +491,14 @@ For each field, we describe the default widget used if you don't specify
If no ``input_formats`` argument is provided, the default input formats are::
If no ``input_formats`` argument is provided, the default input formats are::
['%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
['%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M',
# '2006-10-25 14:30'
'%Y-%m-%d %H:%M',
# '2006-10-25 14:30'
'%Y-%m-%d',
# '2006-10-25'
'%Y-%m-%d',
# '2006-10-25'
'%m/%d/%Y %H:%M:%S',
# '10/25/2006 14:30:59'
'%m/%d/%Y %H:%M:%S',
# '10/25/2006 14:30:59'
'%m/%d/%Y %H:%M',
# '10/25/2006 14:30'
'%m/%d/%Y %H:%M',
# '10/25/2006 14:30'
'%m/%d/%Y',
# '10/25/2006'
'%m/%d/%Y',
# '10/25/2006'
'%m/%d/%y %H:%M:%S',
# '10/25/06 14:30:59'
'%m/%d/%y %H:%M:%S',
# '10/25/06 14:30:59'
'%m/%d/%y %H:%M',
# '10/25/06 14:30'
'%m/%d/%y %H:%M',
# '10/25/06 14:30'
'%m/%d/%y']
# '10/25/06'
'%m/%d/%y']
# '10/25/06'
See also :ref:`format localization <format-localization>`.
See also :ref:`format localization <format-localization>`.
...
...
docs/ref/forms/validation.txt
Dosyayı görüntüle @
b9bf61ce
...
@@ -363,8 +363,10 @@ example::
...
@@ -363,8 +363,10 @@ example::
if cc_myself and subject:
if cc_myself and subject:
# Only do something if both fields are valid so far.
# Only do something if both fields are valid so far.
if "help" not in subject:
if "help" not in subject:
raise forms.ValidationError("Did not send for 'help' in "
raise forms.ValidationError(
"the subject despite CC'ing yourself.")
"Did not send for 'help' in the subject despite "
"CC'ing yourself."
)
In this code, if the validation error is raised, the form will display an
In this code, if the validation error is raised, the form will display an
error message at the top of the form (normally) describing the problem.
error message at the top of the form (normally) describing the problem.
...
...
docs/ref/forms/widgets.txt
Dosyayı görüntüle @
b9bf61ce
...
@@ -55,9 +55,11 @@ widget on the field. In the following example, the
...
@@ -55,9 +55,11 @@ widget on the field. In the following example, the
from django import forms
from django import forms
BIRTH_YEAR_CHOICES = ('1980', '1981', '1982')
BIRTH_YEAR_CHOICES = ('1980', '1981', '1982')
FAVORITE_COLORS_CHOICES = (('blue', 'Blue'),
FAVORITE_COLORS_CHOICES = (
('green', 'Green'),
('blue', 'Blue'),
('black', 'Black'))
('green', 'Green'),
('black', 'Black'),
)
class SimpleForm(forms.Form):
class SimpleForm(forms.Form):
birth_year = forms.DateField(widget=forms.SelectDateWidget(years=BIRTH_YEAR_CHOICES))
birth_year = forms.DateField(widget=forms.SelectDateWidget(years=BIRTH_YEAR_CHOICES))
...
@@ -364,8 +366,11 @@ foundation for custom widgets.
...
@@ -364,8 +366,11 @@ foundation for custom widgets.
widget.value_from_datadict(data, files, name + '_%s' % i)
widget.value_from_datadict(data, files, name + '_%s' % i)
for i, widget in enumerate(self.widgets)]
for i, widget in enumerate(self.widgets)]
try:
try:
D = date(day=int(datelist[0]), month=int(datelist[1]),
D = date(
year=int(datelist[2]))
day=int(datelist[0]),
month=int(datelist[1]),
year=int(datelist[2]),
)
except ValueError:
except ValueError:
return ''
return ''
else:
else:
...
...
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