diff --git a/apis_core/generic/forms.py b/apis_core/generic/forms.py index f1354f48e..494cbbe91 100644 --- a/apis_core/generic/forms.py +++ b/apis_core/generic/forms.py @@ -15,12 +15,15 @@ class GenericFilterSetForm(forms.Form): """ columns = forms.MultipleChoiceField(required=False) + columns_exclude = [] def __init__(self, *args, **kwargs): model = kwargs.pop("model") super().__init__(*args, **kwargs) self.fields["columns"].choices = [ - (field.name, field.verbose_name) for field in model._meta.fields + (field.name, field.verbose_name) + for field in model._meta.fields + if field.name not in self.columns_exclude ] self.helper = FormHelper()