Skip to content

Commit

Permalink
Sorted imports with isort; refs #23860.
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Feb 6, 2015
1 parent 388d986 commit 0ed7d15
Show file tree
Hide file tree
Showing 793 changed files with 2,525 additions and 2,307 deletions.
5 changes: 2 additions & 3 deletions django/apps/config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from importlib import import_module
import os
from importlib import import_module

from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.utils.module_loading import module_has_submodule
from django.utils._os import upath

from django.utils.module_loading import module_has_submodule

MODELS_MODULE_NAME = 'models'

Expand Down
2 changes: 1 addition & 1 deletion django/apps/registry.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections import Counter, defaultdict, OrderedDict
import sys
import threading
import warnings
from collections import Counter, OrderedDict, defaultdict

from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.utils import lru_cache
Expand Down
3 changes: 2 additions & 1 deletion django/conf/project_template/project_name/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


Expand Down
4 changes: 3 additions & 1 deletion django/conf/project_template/project_name/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"""

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")

application = get_wsgi_application()
4 changes: 2 additions & 2 deletions django/contrib/admin/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
Built-in, globally-available admin actions.
"""

from django.core.exceptions import PermissionDenied
from django.contrib import messages
from django.contrib.admin import helpers
from django.contrib.admin.utils import get_deleted_objects, model_ngettext
from django.core.exceptions import PermissionDenied
from django.db import router
from django.template.response import TemplateResponse
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy, ugettext as _
from django.utils.translation import ugettext as _, ugettext_lazy


def delete_selected(modeladmin, request, queryset):
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admin/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.apps import AppConfig
from django.core import checks
from django.contrib.admin.checks import check_admin_app
from django.core import checks
from django.utils.translation import ugettext_lazy as _


Expand Down
8 changes: 6 additions & 2 deletions django/contrib/admin/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@

from itertools import chain

from django.contrib.admin.utils import get_fields_from_path, NotRelationField, flatten
from django.contrib.admin.utils import (
NotRelationField, flatten, get_fields_from_path,
)
from django.core import checks
from django.core.exceptions import FieldDoesNotExist
from django.db import models
from django.forms.models import BaseModelForm, _get_foreign_key, BaseModelFormSet
from django.forms.models import (
BaseModelForm, BaseModelFormSet, _get_foreign_key,
)


def check_admin_app(**kwargs):
Expand Down
14 changes: 8 additions & 6 deletions django/contrib/admin/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
"""
import datetime

from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.utils import (
get_limit_choices_to_from_path, get_model_from_relation,
prepare_lookup_value, reverse_field_path,
)
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.db import models
from django.db.models.fields.related import ForeignObjectRel, ManyToManyField
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils.encoding import smart_text, force_text
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.contrib.admin.utils import (get_model_from_relation,
reverse_field_path, get_limit_choices_to_from_path, prepare_lookup_value)
from django.contrib.admin.options import IncorrectLookupParameters
from django.utils.encoding import force_text, smart_text
from django.utils.translation import ugettext_lazy as _


class ListFilter(object):
Expand Down
1 change: 0 additions & 1 deletion django/contrib/admin/forms.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import unicode_literals

from django import forms

from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm
from django.utils.translation import ugettext_lazy as _

Expand Down
11 changes: 6 additions & 5 deletions django/contrib/admin/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
import warnings

from django import forms
from django.contrib.admin.utils import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.conf import settings
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.admin.utils import (
display_for_field, flatten_fieldsets, help_text_for_field, label_for_field,
lookup_field,
)
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.fields.related import ManyToManyRel
from django.forms.utils import flatatt
from django.template.defaultfilters import capfirst, linebreaksbr
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.encoding import force_text, smart_text
from django.utils.functional import cached_property
from django.utils.html import conditional_escape, format_html
from django.utils.safestring import mark_safe
from django.utils import six
from django.utils.translation import ugettext_lazy as _
from django.conf import settings


ACTION_CHECKBOX_NAME = '_selected_action'

Expand Down
4 changes: 2 additions & 2 deletions django/contrib/admin/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings
import django.contrib.admin.models
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
Expand Down
9 changes: 4 additions & 5 deletions django/contrib/admin/models.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from __future__ import unicode_literals

from django.db import models
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin.utils import quote
from django.core.urlresolvers import reverse, NoReverseMatch
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible, smart_text
from django.utils.translation import ugettext, ugettext_lazy as _
from django.utils.encoding import smart_text
from django.utils.encoding import python_2_unicode_compatible

ADDITION = 1
CHANGE = 2
Expand Down
40 changes: 21 additions & 19 deletions django/contrib/admin/options.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
from collections import OrderedDict
import copy
import operator
from collections import OrderedDict
from functools import partial, reduce, update_wrapper

from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.admin import widgets, helpers
from django.contrib.admin.checks import (BaseModelAdminChecks, ModelAdminChecks,
InlineModelAdminChecks)
from django.contrib.admin import helpers, widgets
from django.contrib.admin.checks import (
BaseModelAdminChecks, InlineModelAdminChecks, ModelAdminChecks,
)
from django.contrib.admin.exceptions import DisallowedModelAdminToField
from django.contrib.admin.utils import (quote, unquote, flatten_fieldsets,
get_deleted_objects, model_format_dict, NestedObjects,
lookup_needs_distinct)
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.utils import (
NestedObjects, flatten_fieldsets, get_deleted_objects,
lookup_needs_distinct, model_format_dict, quote, unquote,
)
from django.contrib.auth import get_permission_codename
from django.core.exceptions import (PermissionDenied, ValidationError,
FieldDoesNotExist, FieldError)
from django.core.exceptions import (
FieldDoesNotExist, FieldError, PermissionDenied, ValidationError,
)
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.db import models, transaction, router
from django.db import models, router, transaction
from django.db.models.constants import LOOKUP_SEP
from django.db.models.fields import BLANK_CHOICE_DASH
from django.db.models.fields.related import ForeignObjectRel
from django.db.models.sql.constants import QUERY_TERMS
from django.forms.formsets import all_valid, DELETION_FIELD_NAME
from django.forms.models import (modelform_factory, modelformset_factory,
inlineformset_factory, BaseInlineFormSet, modelform_defines_fields)
from django.forms.widgets import SelectMultiple, CheckboxSelectMultiple
from django.forms.formsets import DELETION_FIELD_NAME, all_valid
from django.forms.models import (
BaseInlineFormSet, inlineformset_factory, modelform_defines_fields,
modelform_factory, modelformset_factory,
)
from django.forms.widgets import CheckboxSelectMultiple, SelectMultiple
from django.http import Http404, HttpResponseRedirect
from django.http.response import HttpResponseBase
from django.shortcuts import get_object_or_404
Expand All @@ -38,14 +43,11 @@
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import escape, escapejs
from django.utils.http import urlencode
from django.utils.text import capfirst, get_text_list
from django.utils.translation import string_concat
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from django.utils.safestring import mark_safe
from django.utils.text import capfirst, get_text_list
from django.utils.translation import string_concat, ugettext as _, ungettext
from django.views.decorators.csrf import csrf_protect


IS_POPUP_VAR = '_popup'
TO_FIELD_VAR = '_to_field'

Expand Down
15 changes: 8 additions & 7 deletions django/contrib/admin/sites.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
from functools import update_wrapper
from django.http import Http404, HttpResponseRedirect

from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.views.decorators.csrf import csrf_protect
from django.db.models.base import ModelBase
from django.apps import apps
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.core.urlresolvers import reverse, NoReverseMatch
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db.models.base import ModelBase
from django.http import Http404, HttpResponseRedirect
from django.template.engine import Engine
from django.template.response import TemplateResponse
from django.utils import six
from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy, ugettext as _
from django.utils.translation import ugettext as _, ugettext_lazy
from django.views.decorators.cache import never_cache
from django.conf import settings
from django.views.decorators.csrf import csrf_protect

system_check_errors = []

Expand Down
19 changes: 10 additions & 9 deletions django/contrib/admin/templatetags/admin_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@

import datetime

from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.utils import (lookup_field, display_for_field,
display_for_value, label_for_field)
from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE,
ORDER_VAR, PAGE_VAR, SEARCH_VAR)
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.utils import (
display_for_field, display_for_value, label_for_field, lookup_field,
)
from django.contrib.admin.views.main import (
ALL_VAR, EMPTY_CHANGELIST_VALUE, ORDER_VAR, PAGE_VAR, SEARCH_VAR,
)
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import NoReverseMatch
from django.db import models
from django.template import Library
from django.template.loader import get_template
from django.utils import formats
from django.utils.encoding import force_text
from django.utils.html import escapejs, format_html
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.translation import ugettext as _
from django.utils.encoding import force_text
from django.template import Library
from django.template.loader import get_template


register = Library()

Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from django.contrib.auth import get_permission_codename
from django.core.exceptions import FieldDoesNotExist
from django.core.urlresolvers import reverse, NoReverseMatch
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.db.models.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
Expand Down
26 changes: 15 additions & 11 deletions django/contrib/admin/views/main.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
from collections import OrderedDict
import sys
from collections import OrderedDict

from django.core.exceptions import FieldDoesNotExist, SuspiciousOperation, ImproperlyConfigured
from django.contrib.admin import FieldListFilter
from django.contrib.admin.exceptions import (
DisallowedModelAdminLookup, DisallowedModelAdminToField,
)
from django.contrib.admin.options import (
IS_POPUP_VAR, TO_FIELD_VAR, IncorrectLookupParameters,
)
from django.contrib.admin.utils import (
get_fields_from_path, lookup_needs_distinct, prepare_lookup_value, quote,
)
from django.core.exceptions import (
FieldDoesNotExist, ImproperlyConfigured, SuspiciousOperation,
)
from django.core.paginator import InvalidPage
from django.core.urlresolvers import reverse
from django.db import models
from django.utils import six
from django.utils.encoding import force_text
from django.utils.translation import ugettext, ugettext_lazy
from django.utils.http import urlencode

from django.contrib.admin import FieldListFilter
from django.contrib.admin.exceptions import (
DisallowedModelAdminLookup, DisallowedModelAdminToField,
)
from django.contrib.admin.options import IncorrectLookupParameters, IS_POPUP_VAR, TO_FIELD_VAR
from django.contrib.admin.utils import (quote, get_fields_from_path,
lookup_needs_distinct, prepare_lookup_value)
from django.utils.translation import ugettext, ugettext_lazy

# Changelist settings
ALL_VAR = 'all'
Expand Down
12 changes: 7 additions & 5 deletions django/contrib/admin/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
from django.contrib.admin.templatetags.admin_static import static
from django.core.urlresolvers import reverse
from django.db.models.deletion import CASCADE
from django.forms.widgets import Media, RadioFieldRenderer
from django.forms.utils import flatatt
from django.forms.widgets import Media, RadioFieldRenderer
from django.template.loader import render_to_string
from django.utils.html import escape, format_html, format_html_join, smart_urlquote
from django.utils import six
from django.utils.encoding import force_text
from django.utils.html import (
escape, format_html, format_html_join, smart_urlquote,
)
from django.utils.safestring import mark_safe
from django.utils.text import Truncator
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.utils.encoding import force_text
from django.utils import six


class FilteredSelectMultiple(forms.SelectMultiple):
Expand Down
1 change: 0 additions & 1 deletion django/contrib/admindocs/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.apps import AppConfig

from django.utils.translation import ugettext_lazy as _


Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admindocs/middleware.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.conf import settings
from django import http
from django.conf import settings


class XViewMiddleware(object):
Expand Down
Loading

0 comments on commit 0ed7d15

Please sign in to comment.