def make_organization_parameter_formset(org, extra=3):
    class _OrganizationParameterCreateForm(forms.ModelForm):
        remove_from_list = forms.BooleanField(required=False)

        class Meta:
            model = OrganizationParameter
            fields = ['data_type', 'name', 'value', 'owner', ]
            widgets = {
                'data_type': forms.Select(attrs={'class': 'form-control', }),
                'name': forms.TextInput(attrs={'class': 'form-control', }),
                'value': forms.TextInput(attrs={'class': 'form-control', }),
                'owner': forms.HiddenInput(),
            }

        def __init__(self, *args, **kwargs):
            # self.org = org
            super(_OrganizationParameterCreateForm, self).__init__(*args, **kwargs)
            self.fields['owner'].initial = org

    return modelformset_factory(OrganizationParameter, form=_OrganizationParameterCreateForm, extra=extra, can_delete=True)
No package, no read perms, no user
dataset/ETHPy150Open 3bot/3bot/threebot/forms.py/make_organization_parameter_formset--crossover with--dataset/ETHPy150Open mathcamp/pypicloud/tests/test_simple.py/TestCache.test_no_package_no_read_no_user