django-formwizard

Django form wizard save and go to previous step

邮差的信 提交于 2019-12-05 04:31:15
问题 I have a working django formwizard which when I hit the previous button doesn't validate the current input. I've tried variations on <input name="wizard_goto_step" class="btn btn-primary btn-large" type="submit" value="prev"/> and <button class="btn btn-info btn-large" name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}"> {% trans "prev step" %} </button> but neither of these seems to do what I want to do. 回答1: If you want it to validate and save the data on the current form

Django - form wizard step by step

ぐ巨炮叔叔 提交于 2019-12-05 01:37:35
问题 I'm wondering if someone uses django wizard step by step but with back option? I have form with 5 steps and now it is 'one way form' but I would like to develop it by back option (of course data between steps should be remember). Any idea? 回答1: Maybe this will help - http://djangosnippets.org/snippets/1454/ 回答2: Actually, the FormWizard supports this by default when using session or cookie storage. 来源: https://stackoverflow.com/questions/3811250/django-form-wizard-step-by-step

Need clarification on using Django 1.4 Form Wizards, specifically pre-filling and saving

倖福魔咒の 提交于 2019-12-04 23:58:55
问题 We are building a wizard using Django 1.4's new form wizard functionality. The docs on this are very terse and we can't find any advanced examples. We are using a named step wizard (needed to support a listview/datagrid we use) and a session backend. The wizard is meant to edit roles and linked rights and is built to provide both add and edit functionality. We do this by asking the user in the first step if he/she wants to add or edit. The next step depends on that choice; If the user wants

Django-formwizard and ModelFormSet save

安稳与你 提交于 2019-12-04 20:24:48
I am rewriting a big piece of our application which requires a user to create a Project with Rewards attached to it. The form is broken into different steps, the first two are the normal Project , the next one is the Rewards , and then lastly a simple preview that lets the user flick back and forth to create a perfect Project . my forms.py class BaseRewardFormSet(BaseModelFormSet): def __init__(self, *args, **kwargs): super(BaseRewardFormSet, self).__init__(*args, **kwargs) self.queryset = Reward.objects.none() RewardFormSet1 = modelformset_factory(Reward, extra=2, exclude=('project'), formset

Django-Oscar Basket customization

北城余情 提交于 2019-12-04 12:58:30
I am using Djnago-oscar for Solar energy equipment based eCommerce site. I need to add an option to "Basket" model with "Battery Name", "Notes" and "Manufacturer". There is a reason I don't want to add it in subclass AbstractProduct. Rather I want to built it with subclass Basket model. Now I need help to understand my workflow to make this work with AddToBasket form. In Django-oscar/basket there are formsets.py using formset factory and a form. I am a bit confused and decided to get help from community. Following is the code: models.py MANUFACTURERS = ( ('UPS SYSTEMS', 'UPS SYSTEMS'), ('VOLTA

Django form wizard save and go to previous step

十年热恋 提交于 2019-12-03 22:12:53
I have a working django formwizard which when I hit the previous button doesn't validate the current input. I've tried variations on <input name="wizard_goto_step" class="btn btn-primary btn-large" type="submit" value="prev"/> and <button class="btn btn-info btn-large" name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}"> {% trans "prev step" %} </button> but neither of these seems to do what I want to do. If you want it to validate and save the data on the current form before stepping back to a previous form, you need to override the post() method in your subclass of

Django FormWizard Dynamically Alter form_list

爷,独闯天下 提交于 2019-12-03 19:52:59
问题 I'm having some issues with the form wizard, that maybe someone can shed some light on. According docstring in the method process_step: I can "dynamically alter self.form_list". So, based on my project needs, I'm appending forms to the form_list. The forms I'm appending contain questions and answers: http://dpaste.com/hold/152201/ The issue is that when 2 people hit the formwizard at the same time, they start to see each others questions and answers. I guess I don't understand how process

Django - form wizard step by step

…衆ロ難τιáo~ 提交于 2019-12-03 16:05:57
I'm wondering if someone uses django wizard step by step but with back option? I have form with 5 steps and now it is 'one way form' but I would like to develop it by back option (of course data between steps should be remember). Any idea? Maybe this will help - http://djangosnippets.org/snippets/1454/ Actually, the FormWizard supports this by default when using session or cookie storage. 来源: https://stackoverflow.com/questions/3811250/django-form-wizard-step-by-step

How to pass previous form data to the constructor of a DynamicForm in FormWizard

倾然丶 夕夏残阳落幕 提交于 2019-12-03 10:11:01
问题 I have a FormWizard where I need data from the first form to pass to the constructor of the second form so I can build a dynamic form. I can get the first form's data via the process_step of the FormWizard. I create the fields of the second form with a database call of the list of fields. class ConditionWizardDynamicQuestions(forms.Form): def __init__(self, DynamicQuestions=None, *args, **kwargs): super(ConditionWizardDynamicQuestions, self).__init__(*args, **kwargs) questions = Question

How to pass previous form data to the constructor of a DynamicForm in FormWizard

允我心安 提交于 2019-12-02 23:35:28
I have a FormWizard where I need data from the first form to pass to the constructor of the second form so I can build a dynamic form. I can get the first form's data via the process_step of the FormWizard. I create the fields of the second form with a database call of the list of fields. class ConditionWizardDynamicQuestions(forms.Form): def __init__(self, DynamicQuestions=None, *args, **kwargs): super(ConditionWizardDynamicQuestions, self).__init__(*args, **kwargs) questions = Question.objects.filter(MYDATA = DATA_FROM_1STFORM) for q in questions: dynField = FieldFactory(q) self.fields[q