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
646a2216
Kaydet (Commit)
646a2216
authored
May 31, 2013
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #20326 - Corrected form wizard get_form() example.
Thanks tris@ for the report.
üst
f513764e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
form-wizard.txt
docs/ref/contrib/formtools/form-wizard.txt
+9
-2
No files found.
docs/ref/contrib/formtools/form-wizard.txt
Dosyayı görüntüle @
646a2216
...
...
@@ -420,8 +420,10 @@ Advanced ``WizardView`` methods
.. method:: WizardView.get_form(step=None, data=None, files=None)
This method constructs the form for a given ``step``. If no ``step`` is
defined, the current step will be determined automatically.
The method gets three arguments:
defined, the current step will be determined automatically. If you override
``get_form``, however, you will need to set ``step`` yourself using
``self.steps.current`` as in the example below. The method gets three
arguments:
* ``step`` -- The step for which the form instance should be generated.
* ``data`` -- Gets passed to the form's data argument
...
...
@@ -433,6 +435,11 @@ Advanced ``WizardView`` methods
def get_form(self, step=None, data=None, files=None):
form = super(MyWizard, self).get_form(step, data, files)
# determine the step if not given
if step is None:
step = self.steps.current
if step == '1':
form.user = self.request.user
return form
...
...
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