def model_fields_form_factory(model):
fields = model._meta.get_fields()<EOL>choices = []<EOL>for field in fields:<EOL><INDENT>if hasattr(field, "<STR_LIT>"):<EOL><INDENT>choices.append((field.name, field.verbose_name))<EOL><DEDENT><DEDENT>class ModelFieldsForm(forms.Form):<EOL><INDENT>fields = forms.MultipleChoiceField(<EOL>choices=choices,<EOL>required=False,<EOL>)<EOL><DEDENT>return ModelFieldsForm<EOL>
Creates a form for specifying fields from a model to display.