views:

19

answers:

0

Hi,

I want a list of forms with permissions, and one save button..

Like this: http://www.freeimagehosting.net/image.php?c701b302fd.png

But I can't get it working.. Some ideas?

I try to do somethis like this:

forms.py

class ProjectPermission(ModelForm):
class Meta:
    model = ObjectPermission
    exclude = ('content_type', 'object_id')
 ProjectPermFormSet = formset_factory(ProjectPermission, extra=3)

views.py

if request.method == 'POST':
    formset = ProjectPermission(request.POST)    
    if formset.is_valid():
        for form in formset:
            form.save()

    return redirect(overview) 
else:
    PermSet = ProjectPermFormSet()
    return render_with_request(request, "form_perm.html", {'form_perm': PermSet })