views:

28

answers:

2

I'm creating a formset, but it seems to populate it with all of the existing data in the table for that object. I can't figure out how to start with a blank formset; the only way seems to be to delete all of the data from the table, but clearly this isn't an option.

I will post code if necessary (but there's lots of it, so knowing what is relevant is tricky).

A: 

It seems that it isn't possible to change the behaviour of model formset. So as a solution, I changed the data structure so that the data I want to edit is grouped by another type, and then instead I have used inlineformset_factory.

nbolton
+1  A: 

give a parameter queryset=Model.objects.none() when making the object.

Arihant Nahata