Browse files

Fixed #15512 -- Cleanup of imports in contrib.admin. Thanks to Julien…

… Phalip for the patch.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent edfed18 commit 49cfe253991bd255e3293da545ba9af00ab6e18f @freakboy3742 freakboy3742 committed Mar 3, 2011
@@ -1,7 +1,7 @@
from django import forms
from django.conf import settings
-from django.contrib.admin.util import flatten_fieldsets, lookup_field
-from django.contrib.admin.util import display_for_field, label_for_field, help_text_for_field
+from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
+ display_for_field, label_for_field, help_text_for_field)
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.fields.related import ManyToManyRel
@@ -1,10 +1,9 @@
from django import forms, template
from django.forms.formsets import all_valid
-from django.forms.models import modelform_factory, modelformset_factory, inlineformset_factory
-from django.forms.models import BaseInlineFormSet
+from django.forms.models import (modelform_factory, modelformset_factory,
+ inlineformset_factory, BaseInlineFormSet)
from django.contrib.contenttypes.models import ContentType
-from django.contrib.admin import widgets
-from django.contrib.admin import helpers
+from django.contrib.admin import widgets, helpers
from django.contrib.admin.util import unquote, flatten_fieldsets, get_deleted_objects, model_format_dict
from django.contrib import messages
from django.views.decorators.csrf import csrf_protect
@@ -1,8 +1,8 @@
import re
from django import http, template
from django.contrib.admin import ModelAdmin, actions
-from django.contrib.admin.forms import AdminAuthenticationForm, ERROR_MESSAGE
-from django.contrib.auth import REDIRECT_FIELD_NAME, authenticate, login
+from django.contrib.admin.forms import AdminAuthenticationForm
+from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.contenttypes import views as contenttype_views
from django.views.decorators.csrf import csrf_protect
from django.db.models.base import ModelBase
@@ -12,7 +12,7 @@
from django.utils.functional import update_wrapper
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
-from django.utils.translation import ugettext_lazy, ugettext as _
+from django.utils.translation import ugettext as _
from django.views.decorators.cache import never_cache
from django.conf import settings
@@ -2,8 +2,8 @@
from django.conf import settings
from django.contrib.admin.util import lookup_field, display_for_field, label_for_field
-from django.contrib.admin.views.main import ALL_VAR, EMPTY_CHANGELIST_VALUE
-from django.contrib.admin.views.main import ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR
+from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE,
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils import formats
@@ -9,8 +9,7 @@
from django.utils.text import capfirst
from django.utils.encoding import force_unicode, smart_unicode, smart_str
from django.utils.translation import ungettext
-from django.core.urlresolvers import reverse, NoReverseMatch
-from django.utils.datastructures import SortedDict
+from django.core.urlresolvers import reverse
def quote(s):
@@ -4,8 +4,8 @@
from django.forms.models import (BaseModelForm, BaseModelFormSet, fields_for_model,
from django.contrib.admin.util import get_fields_from_path, NotRelationField
-from django.contrib.admin.options import flatten_fieldsets, BaseModelAdmin
-from django.contrib.admin.options import HORIZONTAL, VERTICAL
+from django.contrib.admin.options import (flatten_fieldsets, BaseModelAdmin,
__all__ = ['validate']
@@ -3,10 +3,7 @@
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
-from django import template
-from django.shortcuts import render_to_response
from django.utils.translation import ugettext as _
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth.views import login
from django.contrib.auth import REDIRECT_FIELD_NAME
@@ -2,7 +2,7 @@
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.util import quote, get_fields_from_path
from django.core.exceptions import SuspiciousOperation
-from django.core.paginator import Paginator, InvalidPage
+from django.core.paginator import InvalidPage
from django.db import models
from django.utils.encoding import force_unicode, smart_str
from django.utils.translation import ugettext, ugettext_lazy

0 comments on commit 49cfe25

Please sign in to comment.