#14726: how to get an empty formset in a formwizard?
----------------------------------------+-----------------------------------
 Reporter:  [email protected]            |       Owner:  nobody    
   Status:  new                         |   Milestone:            
Component:  Forms                       |     Version:  1.2       
 Keywords:  empty formset, formwizard,  |       Stage:  Unreviewed
Has_patch:  0                           |  
----------------------------------------+-----------------------------------
 Hi!

 I've already spent a lot of time trying to get this to work, without
 success! I have a formwizard which includes a modelform and a modelformset
 which should be empty.

 On the first page i display the form, on the second follows the
 modelformset, which should be empty and used to add new rows. But it
 always displays all available table rows.
 I've already tried the following:

 class BaseMyModelFormSet(BaseModelFormSet):
     def __init__(self, *args, **kwargs):
         super(BaseMyModelFormSet, self).__init__(*args, **kwargs)
         self.queryset = MyModel2.objects.none()

 In urls.py I did the following:
 ...
 (r'^...$', MyFormWizard([MyModelForm1, modelformset_factory(MyModel2,
 formset=BaseLVFormSet), MyModelForm3])), ...


 But nothing changed... still all available rows are displayed in the
 modelformset.

 After that I tried:

 MyModel2FormSet = modelformset_factory(MyModel2)
 formset =  MyModel2FormSet(MyModel2.objects.none())

 ...
 (r'^...$', MyFormWizard([MyModelForm1, formset, MyModelForm3])), ...

 Now I get an error message, which tells me that MyModel2FormFormSet isn't
 callable...

 Does anyone know what I'm doing wrong? I'm grateful for every hint ;)

 Greetings,
 johnny

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14726>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to