4

python 2.6.5 django 1.2.1

I have multiple inline formsets for 3 different classes, but one of them has a custom delete() method which I need to send extra arguments to.

The main page has a custom save_formset method:

def save_formset(self, request, form, formset, change):
    instances = formset.save(commit=False)
    [..snip..]
    # custom stuff after we get the instances back

The 'Save' of the page dies when it calls formset.save(commit=False) that has the special delete() override which takes an extra argument. The delete works fine when called by itself.

I tried the following before the formset.save(), but it complained that the "object has no attribute 'deleted_objects'"

for obj in formset.deleted_objects:
     obj.delete(request.user)

How do I send in an extra argument to just one of the formsets and not the others?

Brian
  • 41
  • 4

0 Answers0