views:

21

answers:

0

Hi,

I'm using app engine patch for an application on app engine. I have a model formset which works great for editing objects, but I can't use it for adding objects because I can't create an empty formset.

I want the user to be able to add multiple records at once, which I was I am using formsets.

In django, to create an empty formset I can set the queryset using the following: FooFormSet(queryset=Foo.objects.none()). I'm not sure what the equivalent is in app engine. I've tried creating a query that returns nothing e.g. Foo.all().filter('bar =', 'variableThatDoesNotExist'), but the formset then uses all the Foo records. I've tried fetch(0) but this also makes the formset use all Foo records.

Is there any workaround for this?

I may create a regular form, let the user enter the data and submit the form, and then return formset to continue editing/adding additional objects. It doesn't seem very elegant, but I'm not sure about what other way to try.

If someone has a nicer solution, please let me know.

Thanks Bert