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
944a2bb7
Kaydet (Commit)
944a2bb7
authored
Eki 15, 2013
tarafından
Tianyi Wang
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improvement on InlineFormSet doc, refs #21006
üst
9bfe6616
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
modelforms.txt
docs/topics/forms/modelforms.txt
+6
-6
No files found.
docs/topics/forms/modelforms.txt
Dosyayı görüntüle @
944a2bb7
...
@@ -938,7 +938,7 @@ class's ``clean`` method::
...
@@ -938,7 +938,7 @@ class's ``clean`` method::
class MyModelFormSet(BaseModelFormSet):
class MyModelFormSet(BaseModelFormSet):
def clean(self):
def clean(self):
super(MyModelFormSet, self).clean()
super(MyModelFormSet, self).clean()
# example custom validation across forms in the formset
:
# example custom validation across forms in the formset
for form in self.forms:
for form in self.forms:
# your custom formset validation
# your custom formset validation
...
...
...
@@ -1075,14 +1075,14 @@ When overriding methods on ``InlineFormSet``, you should subclass
...
@@ -1075,14 +1075,14 @@ When overriding methods on ``InlineFormSet``, you should subclass
:class:`~models.BaseInlineFormSet` rather than
:class:`~models.BaseInlineFormSet` rather than
:class:`~models.BaseModelFormSet`.
:class:`~models.BaseModelFormSet`.
For example,
I
f you want to override ``clean()``::
For example,
i
f you want to override ``clean()``::
from django.forms.models import BaseInlineFormSet
from django.forms.models import BaseInlineFormSet
class
MyModel
FormSet(BaseInlineFormSet):
class
CustomInline
FormSet(BaseInlineFormSet):
def clean(self):
def clean(self):
super(
MyModel
FormSet, self).clean()
super(
CustomInline
FormSet, self).clean()
# example custom validation across forms in the formset
:
# example custom validation across forms in the formset
for form in self.forms:
for form in self.forms:
# your custom formset validation
# your custom formset validation
...
...
...
@@ -1093,7 +1093,7 @@ Then when you create your inline formset, pass in the optional argument
...
@@ -1093,7 +1093,7 @@ Then when you create your inline formset, pass in the optional argument
``formset``::
``formset``::
>>> from django.forms.models import inlineformset_factory
>>> from django.forms.models import inlineformset_factory
>>> BookFormSet = inlineformset_factory(Author, Book, formset=
MyModel
FormSet)
>>> BookFormSet = inlineformset_factory(Author, Book, formset=
CustomInline
FormSet)
>>> author = Author.objects.get(name=u'Mike Royko')
>>> author = Author.objects.get(name=u'Mike Royko')
>>> formset = BookFormSet(instance=author)
>>> formset = BookFormSet(instance=author)
...
...
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