From 1c7a83ee8e3da431d9d21dae42da8f1f89973f7c Mon Sep 17 00:00:00 2001 From: Loic Bistuer Date: Fri, 22 Nov 2013 17:23:12 +0700 Subject: [PATCH] Fixed #21489 -- Make formsets directly importable from django.forms. --- django/forms/__init__.py | 1 + django/forms/formsets.py | 2 +- django/forms/models.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/django/forms/__init__.py b/django/forms/__init__.py index c6573388db..e0be2d164f 100644 --- a/django/forms/__init__.py +++ b/django/forms/__init__.py @@ -5,5 +5,6 @@ Django validation and HTML form handling. from django.core.exceptions import ValidationError # NOQA from django.forms.fields import * # NOQA from django.forms.forms import * # NOQA +from django.forms.formsets import * # NOQA from django.forms.models import * # NOQA from django.forms.widgets import * # NOQA diff --git a/django/forms/formsets.py b/django/forms/formsets.py index 625f597117..3759d3381d 100644 --- a/django/forms/formsets.py +++ b/django/forms/formsets.py @@ -13,7 +13,7 @@ from django.utils.six.moves import xrange from django.utils.translation import ungettext, ugettext as _ -__all__ = ('BaseFormSet', 'all_valid') +__all__ = ('BaseFormSet', 'formset_factory', 'all_valid') # special field names TOTAL_FORM_COUNT = 'TOTAL_FORMS' diff --git a/django/forms/models.py b/django/forms/models.py index 3625dc8334..e9bd338064 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -24,7 +24,8 @@ from django.utils.translation import ugettext_lazy as _, ugettext, string_concat __all__ = ( 'ModelForm', 'BaseModelForm', 'model_to_dict', 'fields_for_model', 'save_instance', 'ModelChoiceField', 'ModelMultipleChoiceField', - 'ALL_FIELDS', + 'ALL_FIELDS', 'BaseModelFormSet', 'modelformset_factory', + 'BaseInlineFormSet', 'inlineformset_factory', ) ALL_FIELDS = '__all__'