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
57169899
Kaydet (Commit)
57169899
authored
Eyl 08, 2012
tarafından
Nick Martini
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fixing modelforms example code, ticket #18832
üst
b7d3b057
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
modelforms.txt
docs/topics/forms/modelforms.txt
+3
-3
No files found.
docs/topics/forms/modelforms.txt
Dosyayı görüntüle @
57169899
...
@@ -311,18 +311,18 @@ model fields:
...
@@ -311,18 +311,18 @@ model fields:
to exclude from the form.
to exclude from the form.
For example, if you want a form for the ``Author`` model (defined
For example, if you want a form for the ``Author`` model (defined
above) that includes only the ``name`` and ``
titl
e`` fields, you would
above) that includes only the ``name`` and ``
birth_dat
e`` fields, you would
specify ``fields`` or ``exclude`` like this::
specify ``fields`` or ``exclude`` like this::
class PartialAuthorForm(ModelForm):
class PartialAuthorForm(ModelForm):
class Meta:
class Meta:
model = Author
model = Author
fields = ('name', '
titl
e')
fields = ('name', '
birth_dat
e')
class PartialAuthorForm(ModelForm):
class PartialAuthorForm(ModelForm):
class Meta:
class Meta:
model = Author
model = Author
exclude = ('
birth_dat
e',)
exclude = ('
titl
e',)
Since the Author model has only 3 fields, 'name', 'title', and
Since the Author model has only 3 fields, 'name', 'title', and
'birth_date', the forms above will contain exactly the same fields.
'birth_date', the forms above will contain exactly the same fields.
...
...
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