[1.8.x] Sorted imports with isort; refs #23860.
Backport of 0ed7d15563
from master
This commit is contained in:
parent
eb406aa686
commit
a8b70d251d
|
@ -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'
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
from collections import Counter, defaultdict, OrderedDict
|
||||
import os
|
||||
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
|
||||
from django.utils.deprecation import RemovedInDjango19Warning
|
||||
from django.utils._os import upath
|
||||
from django.utils.deprecation import RemovedInDjango19Warning
|
||||
|
||||
from .config import AppConfig
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
|
|||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
import os
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,9 @@ https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/wsgi/
|
|||
"""
|
||||
|
||||
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()
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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 _
|
||||
|
||||
|
||||
|
|
|
@ -3,11 +3,15 @@ from __future__ import unicode_literals
|
|||
|
||||
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):
|
||||
|
|
|
@ -7,15 +7,17 @@ certain test -- e.g. being a DateField or ForeignKey.
|
|||
"""
|
||||
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):
|
||||
|
|
|
@ -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 _
|
||||
|
||||
|
|
|
@ -3,22 +3,23 @@ from __future__ import unicode_literals
|
|||
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'
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,37 +1,42 @@
|
|||
from collections import OrderedDict
|
||||
import copy
|
||||
import operator
|
||||
from functools import partial, reduce, update_wrapper
|
||||
import warnings
|
||||
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 import validation
|
||||
from django.contrib.admin.checks import (BaseModelAdminChecks, ModelAdminChecks,
|
||||
InlineModelAdminChecks)
|
||||
from django.contrib.admin import helpers, validation, 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 import checks
|
||||
from django.core.exceptions import (PermissionDenied, ValidationError,
|
||||
FieldDoesNotExist, FieldError, ImproperlyConfigured)
|
||||
from django.core.exceptions import (
|
||||
FieldDoesNotExist, FieldError, ImproperlyConfigured, 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
|
||||
|
@ -42,14 +47,11 @@ from django.utils.deprecation import RemovedInDjango19Warning
|
|||
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'
|
||||
|
||||
|
|
|
@ -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 = []
|
||||
|
||||
|
|
|
@ -2,24 +2,25 @@ from __future__ import unicode_literals
|
|||
|
||||
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()
|
||||
|
||||
|
|
|
@ -6,4 +6,4 @@ warnings.warn(
|
|||
"The django.contrib.admin.util module has been renamed. "
|
||||
"Use django.contrib.admin.utils instead.", RemovedInDjango19Warning)
|
||||
|
||||
from django.contrib.admin.utils import * # NOQA
|
||||
from django.contrib.admin.utils import * # NOQA isort:skip
|
||||
|
|
|
@ -6,7 +6,7 @@ from collections import defaultdict
|
|||
|
||||
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
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
from django.contrib.admin.utils import NotRelationField, get_fields_from_path
|
||||
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
|
||||
from django.db import models
|
||||
from django.forms.models import BaseModelForm, BaseModelFormSet, _get_foreign_key
|
||||
from django.contrib.admin.utils import get_fields_from_path, NotRelationField
|
||||
from django.forms.models import (
|
||||
BaseModelForm, BaseModelFormSet, _get_foreign_key,
|
||||
)
|
||||
|
||||
"""
|
||||
Does basic ModelAdmin option validation. Calls custom validation
|
||||
|
|
|
@ -1,22 +1,26 @@
|
|||
from collections import OrderedDict
|
||||
import sys
|
||||
|
||||
from django.core.exceptions import FieldDoesNotExist, SuspiciousOperation, ImproperlyConfigured
|
||||
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 collections import OrderedDict
|
||||
|
||||
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.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.http import urlencode
|
||||
from django.utils.translation import ugettext, ugettext_lazy
|
||||
|
||||
# Changelist settings
|
||||
ALL_VAR = 'all'
|
||||
|
|
|
@ -9,15 +9,17 @@ from django import forms
|
|||
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):
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django.conf import settings
|
||||
from django import http
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class XViewMiddleware(object):
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
"Misc. utility functions/classes for admin documentation generator."
|
||||
|
||||
import re
|
||||
from email.parser import HeaderParser
|
||||
from email.errors import HeaderParseError
|
||||
from email.parser import HeaderParser
|
||||
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.encoding import force_bytes
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
try:
|
||||
import docutils.core
|
||||
import docutils.nodes
|
||||
|
|
|
@ -1,23 +1,25 @@
|
|||
from importlib import import_module
|
||||
import inspect
|
||||
import os
|
||||
import re
|
||||
from importlib import import_module
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin.views.decorators import staff_member_required
|
||||
from django.db import models
|
||||
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
|
||||
from django.http import Http404
|
||||
from django.core import urlresolvers
|
||||
from django.contrib.admindocs import utils
|
||||
from django.template.base import (builtins, get_library,
|
||||
get_templatetags_modules, InvalidTemplateLibrary, libraries)
|
||||
from django.core import urlresolvers
|
||||
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
|
||||
from django.db import models
|
||||
from django.http import Http404
|
||||
from django.template.base import (
|
||||
InvalidTemplateLibrary, builtins, get_library, get_templatetags_modules,
|
||||
libraries,
|
||||
)
|
||||
from django.template.engine import Engine
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils._os import upath
|
||||
from django.utils import six
|
||||
from django.utils._os import upath
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
from django.db import transaction
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
from django.contrib import admin
|
||||
from django.contrib import admin, messages
|
||||
from django.contrib.admin.options import IS_POPUP_VAR
|
||||
from django.contrib.auth import update_session_auth_hash
|
||||
from django.contrib.auth.forms import (UserCreationForm, UserChangeForm,
|
||||
AdminPasswordChangeForm)
|
||||
from django.contrib.auth.models import User, Group
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.forms import (
|
||||
AdminPasswordChangeForm, UserChangeForm, UserCreationForm,
|
||||
)
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.http import HttpResponseRedirect, Http404
|
||||
from django.db import transaction
|
||||
from django.http import Http404, HttpResponseRedirect
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.html import escape
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils.html import escape
|
||||
from django.utils.translation import ugettext, ugettext_lazy as _
|
||||
from django.views.decorators.csrf import csrf_protect
|
||||
from django.views.decorators.debug import sensitive_post_parameters
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
from django.core import checks
|
||||
from django.contrib.auth.checks import check_user_model
|
||||
from django.core import checks
|
||||
from django.db.models.signals import post_migrate
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import Permission
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from functools import wraps
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.shortcuts import resolve_url
|
||||
from django.utils.decorators import available_attrs
|
||||
from django.utils.six.moves.urllib.parse import urlparse
|
||||
from django.shortcuts import resolve_url
|
||||
|
||||
|
||||
def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):
|
||||
|
|
|
@ -3,6 +3,13 @@ from __future__ import unicode_literals
|
|||
from collections import OrderedDict
|
||||
|
||||
from django import forms
|
||||
from django.contrib.auth import authenticate, get_user_model
|
||||
from django.contrib.auth.hashers import (
|
||||
UNUSABLE_PASSWORD_PREFIX, identify_hasher,
|
||||
)
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.tokens import default_token_generator
|
||||
from django.contrib.sites.shortcuts import get_current_site
|
||||
from django.core.mail import EmailMultiAlternatives
|
||||
from django.forms.utils import flatatt
|
||||
from django.template import loader
|
||||
|
@ -13,12 +20,6 @@ from django.utils.safestring import mark_safe
|
|||
from django.utils.text import capfirst
|
||||
from django.utils.translation import ugettext, ugettext_lazy as _
|
||||
|
||||
from django.contrib.auth import authenticate, get_user_model
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX, identify_hasher
|
||||
from django.contrib.auth.tokens import default_token_generator
|
||||
from django.contrib.sites.shortcuts import get_current_site
|
||||
|
||||
|
||||
class ReadOnlyPasswordHashWidget(forms.Widget):
|
||||
def render(self, name, value, attrs):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django.contrib import auth
|
||||
from django import db
|
||||
from django.contrib import auth
|
||||
from django.utils.encoding import force_bytes
|
||||
|
||||
|
||||
|
|
|
@ -2,22 +2,22 @@ from __future__ import unicode_literals
|
|||
|
||||
import base64
|
||||
import binascii
|
||||
from collections import OrderedDict
|
||||
import hashlib
|
||||
import importlib
|
||||
from collections import OrderedDict
|
||||
|
||||
from django.dispatch import receiver
|
||||
from django.conf import settings
|
||||
from django.core.signals import setting_changed
|
||||
from django.utils.encoding import force_bytes, force_str, force_text
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils.crypto import (
|
||||
pbkdf2, constant_time_compare, get_random_string)
|
||||
from django.core.signals import setting_changed
|
||||
from django.dispatch import receiver
|
||||
from django.utils import lru_cache
|
||||
from django.utils.crypto import (
|
||||
constant_time_compare, get_random_string, pbkdf2,
|
||||
)
|
||||
from django.utils.encoding import force_bytes, force_str, force_text
|
||||
from django.utils.module_loading import import_string
|
||||
from django.utils.translation import ugettext_noop as _
|
||||
|
||||
|
||||
UNUSABLE_PASSWORD_PREFIX = '!' # This will never be a valid encoded hash
|
||||
UNUSABLE_PASSWORD_SUFFIX_LENGTH = 40 # number of random chars to add after UNUSABLE_PASSWORD_PREFIX
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core import validators
|
||||
from django.db import models, migrations
|
||||
from django.utils import timezone
|
||||
import django.contrib.auth.models
|
||||
from django.core import validators
|
||||
from django.db import migrations, models
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,21 +1,20 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.core.mail import send_mail
|
||||
from django.core import validators
|
||||
from django.db import models
|
||||
from django.db.models.manager import EmptyManager
|
||||
from django.utils.crypto import get_random_string, salted_hmac
|
||||
from django.utils import six
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils import timezone
|
||||
|
||||
from django.contrib import auth
|
||||
from django.contrib.auth.hashers import (
|
||||
check_password, make_password, is_password_usable)
|
||||
check_password, is_password_usable, make_password,
|
||||
)
|
||||
from django.contrib.auth.signals import user_logged_in
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core import validators
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.core.mail import send_mail
|
||||
from django.db import models
|
||||
from django.db.models.manager import EmptyManager
|
||||
from django.utils import six, timezone
|
||||
from django.utils.crypto import get_random_string, salted_hmac
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
def update_last_login(sender, user, **kwargs):
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
# For testing that auth backends can be referenced using a convenience import
|
||||
from django.contrib.auth.tests.test_auth_backends import ImportedModelBackend # NOQA
|
||||
from .test_auth_backends import ImportedModelBackend
|
||||
|
||||
__all__ = ['ImportedModelBackend']
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth.models import (
|
||||
BaseUserManager,
|
||||
AbstractBaseUser,
|
||||
AbstractUser,
|
||||
UserManager,
|
||||
PermissionsMixin,
|
||||
Group,
|
||||
Permission,
|
||||
AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission,
|
||||
PermissionsMixin, UserManager,
|
||||
)
|
||||
from django.db import models
|
||||
|
||||
|
||||
# The custom User uses email as the unique identifier, and requires
|
||||
|
|
|
@ -2,7 +2,6 @@ import os
|
|||
|
||||
from django.utils._os import upath
|
||||
|
||||
|
||||
AUTH_MIDDLEWARE_CLASSES = (
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
|
|
|
@ -1,17 +1,20 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from datetime import date
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import BACKEND_SESSION_KEY, authenticate, get_user
|
||||
from django.contrib.auth.backends import ModelBackend
|
||||
from django.contrib.auth.models import User, Group, Permission, AnonymousUser
|
||||
from django.contrib.auth.hashers import MD5PasswordHasher
|
||||
from django.contrib.auth.models import AnonymousUser, Group, Permission, User
|
||||
from django.contrib.auth.tests.custom_user import (
|
||||
CustomPermissionsUser, CustomUser, ExtensionUser,
|
||||
)
|
||||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.contrib.auth.tests.custom_user import ExtensionUser, CustomPermissionsUser, CustomUser
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
|
||||
from django.contrib.auth import authenticate, BACKEND_SESSION_KEY, get_user
|
||||
from django.http import HttpRequest
|
||||
from django.test import TestCase, override_settings
|
||||
from django.contrib.auth.hashers import MD5PasswordHasher
|
||||
|
||||
|
||||
class CountingMD5PasswordHasher(MD5PasswordHasher):
|
||||
|
|
|
@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
|||
|
||||
from django.apps import apps
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import User, AnonymousUser
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.contrib.auth.tests.custom_user import CustomUser
|
||||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from django.contrib.auth import authenticate
|
||||
from django.contrib.auth.models import User, Permission
|
||||
from django.contrib.auth.context_processors import PermLookupDict, PermWrapper
|
||||
from django.contrib.auth.models import Permission, User
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.auth.context_processors import PermWrapper, PermLookupDict
|
||||
from django.db.models import Q
|
||||
from django.test import TestCase, override_settings
|
||||
|
||||
|
|
|
@ -3,16 +3,18 @@ from __future__ import unicode_literals
|
|||
import re
|
||||
|
||||
from django import forms
|
||||
from django.contrib.auth.forms import (
|
||||
AuthenticationForm, PasswordChangeForm, PasswordResetForm,
|
||||
ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget, SetPasswordForm,
|
||||
UserChangeForm, UserCreationForm,
|
||||
)
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm,
|
||||
PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm,
|
||||
ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget)
|
||||
from django.core import mail
|
||||
from django.core.mail import EmailMultiAlternatives
|
||||
from django.forms.fields import Field, CharField
|
||||
from django.forms.fields import CharField, Field
|
||||
from django.test import TestCase, override_settings
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils import translation
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.text import capfirst
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.contrib.auth.handlers.modwsgi import check_password, groups_for_user
|
||||
from django.contrib.auth.models import User, Group
|
||||
from django.contrib.auth.handlers.modwsgi import (
|
||||
check_password, groups_for_user,
|
||||
)
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.contrib.auth.tests.custom_user import CustomUser
|
||||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.test import TransactionTestCase
|
||||
from django.test import override_settings
|
||||
from django.test import TransactionTestCase, override_settings
|
||||
|
||||
|
||||
# This must be a TransactionTestCase because the WSGI auth handler performs
|
||||
|
|
|
@ -4,14 +4,16 @@ from __future__ import unicode_literals
|
|||
from unittest import skipUnless
|
||||
|
||||
from django.conf.global_settings import PASSWORD_HASHERS
|
||||
from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
|
||||
check_password, make_password, PBKDF2PasswordHasher, PBKDF2SHA1PasswordHasher,
|
||||
get_hasher, identify_hasher, UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH)
|
||||
from django.contrib.auth.hashers import (
|
||||
UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH,
|
||||
BasePasswordHasher, PBKDF2PasswordHasher, PBKDF2SHA1PasswordHasher,
|
||||
check_password, get_hasher, identify_hasher, is_password_usable,
|
||||
make_password,
|
||||
)
|
||||
from django.test import SimpleTestCase
|
||||
from django.test.utils import override_settings
|
||||
from django.utils import six
|
||||
|
||||
|
||||
try:
|
||||
import crypt
|
||||
except ImportError:
|
||||
|
|
|
@ -1,20 +1,23 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from datetime import date
|
||||
import locale
|
||||
import sys
|
||||
from datetime import date
|
||||
|
||||
from django.apps import apps
|
||||
from django.contrib.auth import models, management
|
||||
from django.contrib.auth import management, models
|
||||
from django.contrib.auth.checks import check_user_model
|
||||
from django.contrib.auth.management import create_permissions
|
||||
from django.contrib.auth.management.commands import changepassword, createsuperuser
|
||||
from django.contrib.auth.models import User, Group
|
||||
from django.contrib.auth.tests.custom_user import CustomUser, CustomUserWithFK, Email
|
||||
from django.contrib.auth.management.commands import (
|
||||
changepassword, createsuperuser,
|
||||
)
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.contrib.auth.tests.custom_user import (
|
||||
CustomUser, CustomUserWithFK, Email,
|
||||
)
|
||||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core import checks
|
||||
from django.core import exceptions
|
||||
from django.core import checks, exceptions
|
||||
from django.core.management import call_command
|
||||
from django.core.management.base import CommandError
|
||||
from django.test import TestCase, override_settings, override_system_checks
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import AbstractUser, Group, Permission, User, UserManager
|
||||
from django.contrib.auth.models import (
|
||||
AbstractUser, Group, Permission, User, UserManager,
|
||||
)
|
||||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core import mail
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
from django.contrib.auth import signals
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.test import TestCase
|
||||
from django.test import TestCase, override_settings
|
||||
from django.test.client import RequestFactory
|
||||
from django.test import override_settings
|
||||
|
||||
|
||||
@skipIfCustomUser
|
||||
|
|
|
@ -3,11 +3,10 @@ from django.contrib.auth.models import User
|
|||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.contrib.auth.tokens import PasswordResetTokenGenerator
|
||||
from django.contrib.auth.views import (
|
||||
password_reset, password_reset_done, password_reset_confirm,
|
||||
password_reset_complete, password_change, password_change_done,
|
||||
password_change, password_change_done, password_reset,
|
||||
password_reset_complete, password_reset_confirm, password_reset_done,
|
||||
)
|
||||
from django.test import RequestFactory, TestCase
|
||||
from django.test import override_settings
|
||||
from django.test import RequestFactory, TestCase, override_settings
|
||||
from django.utils.encoding import force_bytes, force_text
|
||||
from django.utils.http import urlsafe_base64_encode
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
from datetime import date, timedelta
|
||||
import sys
|
||||
import unittest
|
||||
from datetime import date, timedelta
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.tokens import PasswordResetTokenGenerator
|
||||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.contrib.auth.tokens import PasswordResetTokenGenerator
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
|
|
|
@ -1,31 +1,32 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from importlib import import_module
|
||||
import itertools
|
||||
import re
|
||||
from importlib import import_module
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.contrib.sites.requests import RequestSite
|
||||
from django.contrib.admin.models import LogEntry
|
||||
from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME
|
||||
from django.contrib.auth.forms import (AuthenticationForm, PasswordChangeForm,
|
||||
SetPasswordForm)
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME, SESSION_KEY
|
||||
from django.contrib.auth.forms import (
|
||||
AuthenticationForm, PasswordChangeForm, SetPasswordForm,
|
||||
)
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.views import login as login_view, redirect_to_login
|
||||
from django.contrib.sessions.middleware import SessionMiddleware
|
||||
from django.contrib.sites.requests import RequestSite
|
||||
from django.core import mail
|
||||
from django.core.urlresolvers import NoReverseMatch, reverse, reverse_lazy
|
||||
from django.http import QueryDict, HttpRequest
|
||||
from django.http import HttpRequest, QueryDict
|
||||
from django.middleware.csrf import CsrfViewMiddleware
|
||||
from django.test import TestCase, ignore_warnings, override_settings
|
||||
from django.test.utils import patch_logger
|
||||
from django.utils.deprecation import RemovedInDjango20Warning
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.http import urlquote
|
||||
from django.utils.six.moves.urllib.parse import urlparse, ParseResult
|
||||
from django.utils.six.moves.urllib.parse import ParseResult, urlparse
|
||||
from django.utils.translation import LANGUAGE_SESSION_KEY
|
||||
from django.test import TestCase, ignore_warnings, override_settings
|
||||
from django.test.utils import patch_logger
|
||||
from django.middleware.csrf import CsrfViewMiddleware
|
||||
from django.contrib.sessions.middleware import SessionMiddleware
|
||||
|
||||
# Needed so model is installed when tests are run independently:
|
||||
from .custom_user import CustomUser # NOQA
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
from django.conf.urls import url, include
|
||||
from django.conf.urls import include, url
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
from django.contrib.auth.urls import urlpatterns
|
||||
from django.contrib.auth import views
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
from django.contrib.auth.urls import urlpatterns
|
||||
from django.contrib.messages.api import info
|
||||
from django.http import HttpResponse, HttpRequest
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.template import Template, RequestContext
|
||||
from django.template import RequestContext, Template
|
||||
from django.views.decorators.cache import never_cache
|
||||
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ Test URLs for auth admins.
|
|||
|
||||
from django.conf.urls import include, url
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.admin import UserAdmin, GroupAdmin
|
||||
from django.contrib.auth.models import User, Group
|
||||
from django.contrib.auth.admin import GroupAdmin, UserAdmin
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.contrib.auth.urls import urlpatterns
|
||||
|
||||
# Create a silo'd admin site for just the user/group admins.
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from datetime import date
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.http import int_to_base36, base36_to_int
|
||||
from django.utils.crypto import constant_time_compare, salted_hmac
|
||||
from django.utils import six
|
||||
from django.utils.crypto import constant_time_compare, salted_hmac
|
||||
from django.utils.http import base36_to_int, int_to_base36
|
||||
|
||||
|
||||
class PasswordResetTokenGenerator(object):
|
||||
|
|
|
@ -1,25 +1,28 @@
|
|||
import warnings
|
||||
|
||||
from django.conf import settings
|
||||
# Avoid shadowing the login() and logout() views below.
|
||||
from django.contrib.auth import (
|
||||
REDIRECT_FIELD_NAME, get_user_model, login as auth_login,
|
||||
logout as auth_logout, update_session_auth_hash,
|
||||
)
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.auth.forms import (
|
||||
AuthenticationForm, PasswordChangeForm, PasswordResetForm, SetPasswordForm,
|
||||
)
|
||||
from django.contrib.auth.tokens import default_token_generator
|
||||
from django.contrib.sites.shortcuts import get_current_site
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.http import HttpResponseRedirect, QueryDict
|
||||
from django.shortcuts import resolve_url
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.deprecation import RemovedInDjango20Warning
|
||||
from django.utils.http import is_safe_url, urlsafe_base64_decode
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.six.moves.urllib.parse import urlparse, urlunparse
|
||||
from django.shortcuts import resolve_url
|
||||
from django.views.decorators.debug import sensitive_post_parameters
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.decorators.cache import never_cache
|
||||
from django.views.decorators.csrf import csrf_protect
|
||||
|
||||
# Avoid shadowing the login() and logout() views below.
|
||||
from django.contrib.auth import (REDIRECT_FIELD_NAME, login as auth_login,
|
||||
logout as auth_logout, get_user_model, update_session_auth_hash)
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.auth.forms import AuthenticationForm, PasswordResetForm, SetPasswordForm, PasswordChangeForm
|
||||
from django.contrib.auth.tokens import default_token_generator
|
||||
from django.contrib.sites.shortcuts import get_current_site
|
||||
from django.views.decorators.debug import sensitive_post_parameters
|
||||
|
||||
|
||||
@sensitive_post_parameters()
|
||||
|
|
|
@ -6,7 +6,7 @@ from django.contrib.admin.checks import InlineModelAdminChecks
|
|||
from django.contrib.admin.options import InlineModelAdmin, flatten_fieldsets
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.forms import (
|
||||
BaseGenericInlineFormSet, generic_inlineformset_factory
|
||||
BaseGenericInlineFormSet, generic_inlineformset_factory,
|
||||
)
|
||||
from django.core import checks
|
||||
from django.core.exceptions import FieldDoesNotExist
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.utils import six
|
||||
from django.apps import apps
|
||||
from django.utils import six
|
||||
|
||||
|
||||
def check_generic_foreign_keys(**kwargs):
|
||||
|
|
|
@ -2,16 +2,15 @@ from __future__ import unicode_literals
|
|||
|
||||
from collections import defaultdict
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core import checks
|
||||
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
|
||||
from django.db import connection
|
||||
from django.db import models, router, transaction, DEFAULT_DB_ALIAS
|
||||
from django.db.models import signals, DO_NOTHING
|
||||
from django.db import DEFAULT_DB_ALIAS, connection, models, router, transaction
|
||||
from django.db.models import DO_NOTHING, signals
|
||||
from django.db.models.base import ModelBase
|
||||
from django.db.models.fields.related import ForeignObject, ForeignObjectRel
|
||||
from django.db.models.query_utils import PathInfo
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.utils.encoding import smart_text, python_2_unicode_compatible
|
||||
from django.utils.encoding import python_2_unicode_compatible, smart_text
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import models
|
||||
from django.forms import ModelForm, modelformset_factory
|
||||
from django.forms.models import BaseModelFormSet
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
|
||||
|
||||
class BaseGenericInlineFormSet(BaseModelFormSet):
|
||||
|
|
|
@ -10,12 +10,12 @@ warnings.warn(
|
|||
'submodules of django.contrib.contenttypes.'), RemovedInDjango19Warning, stacklevel=2
|
||||
)
|
||||
|
||||
from django.contrib.contenttypes.admin import ( # NOQA
|
||||
GenericInlineModelAdmin, GenericStackedInline, GenericTabularInline
|
||||
from django.contrib.contenttypes.admin import ( # NOQA isort:skip
|
||||
GenericInlineModelAdmin, GenericStackedInline, GenericTabularInline,
|
||||
)
|
||||
from django.contrib.contenttypes.fields import ( # NOQA
|
||||
GenericForeignKey, GenericRelation
|
||||
from django.contrib.contenttypes.fields import ( # NOQA isort:skip
|
||||
GenericForeignKey, GenericRelation,
|
||||
)
|
||||
from django.contrib.contenttypes.forms import ( # NOQA
|
||||
BaseGenericInlineFormSet, generic_inlineformset_factory
|
||||
from django.contrib.contenttypes.forms import ( # NOQA isort:skip
|
||||
BaseGenericInlineFormSet, generic_inlineformset_factory,
|
||||
)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
import django.contrib.contenttypes.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def add_legacy_name(apps, schema_editor):
|
||||
|
|
|
@ -5,9 +5,9 @@ import warnings
|
|||
from django.apps import apps
|
||||
from django.db import models
|
||||
from django.db.utils import OperationalError, ProgrammingError
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.deprecation import RemovedInDjango20Warning
|
||||
from django.utils.encoding import force_text, python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
class ContentTypeManager(models.Manager):
|
||||
|
|
|
@ -9,7 +9,10 @@ from django.http import Http404, HttpRequest
|
|||
from django.test import TestCase, override_settings
|
||||
from django.utils import six
|
||||
|
||||
from .models import ConcreteModel, ProxyModel, FooWithoutUrl, FooWithUrl, FooWithBrokenAbsoluteUrl
|
||||
from .models import (
|
||||
ConcreteModel, FooWithBrokenAbsoluteUrl, FooWithoutUrl, FooWithUrl,
|
||||
ProxyModel,
|
||||
)
|
||||
|
||||
|
||||
class ContentTypesTests(TestCase):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from django.contrib import admin
|
||||
from django.contrib.flatpages.forms import FlatpageForm
|
||||
from django.contrib.flatpages.models import FlatPage
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.flatpages.forms import FlatpageForm
|
||||
|
||||
|
||||
class FlatPageAdmin(admin.ModelAdmin):
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.conf import settings
|
||||
from django.contrib.flatpages.views import flatpage
|
||||
from django.http import Http404
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class FlatpageFallbackMiddleware(object):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models
|
||||
from django.contrib.sites.models import Site
|
||||
from django.core.urlresolvers import get_script_prefix
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.db import models
|
||||
from django.utils.encoding import iri_to_uri, python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
|
|
|
@ -3,7 +3,6 @@ from django.conf import settings
|
|||
from django.contrib.flatpages.models import FlatPage
|
||||
from django.contrib.sites.shortcuts import get_current_site
|
||||
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import os
|
||||
|
||||
|
||||
FLATPAGES_TEMPLATES = [{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [os.path.join(os.path.dirname(__file__), 'templates')],
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.test import TestCase, Client
|
||||
from django.test import override_settings
|
||||
from django.test import Client, TestCase, override_settings
|
||||
|
||||
from .settings import FLATPAGES_TEMPLATES
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core.urlresolvers import set_script_prefix, clear_script_prefix
|
||||
from django.contrib.flatpages.models import FlatPage
|
||||
from django.core.urlresolvers import clear_script_prefix, set_script_prefix
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.template import Template, Context, TemplateSyntaxError
|
||||
from django.template import Context, Template, TemplateSyntaxError
|
||||
from django.test import TestCase, override_settings
|
||||
|
||||
from .settings import FLATPAGES_TEMPLATES
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from django.contrib.admin import ModelAdmin
|
||||
from django.contrib.gis.admin.widgets import OpenLayersWidget
|
||||
from django.contrib.gis.gdal import HAS_GDAL, OGRGeomType
|
||||
from django.contrib.gis.db import models
|
||||
from django.contrib.gis.gdal import HAS_GDAL, OGRGeomType
|
||||
|
||||
|
||||
class GeoModelAdmin(ModelAdmin):
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
import logging
|
||||
|
||||
from django.contrib.gis.gdal import GDALException
|
||||
from django.contrib.gis.geos import GEOSException, GEOSGeometry
|
||||
from django.forms.widgets import Textarea
|
||||
from django.template import loader
|
||||
from django.utils import six
|
||||
from django.utils import translation
|
||||
|
||||
from django.contrib.gis.gdal import GDALException
|
||||
from django.contrib.gis.geos import GEOSGeometry, GEOSException
|
||||
from django.utils import six, translation
|
||||
|
||||
# Creating a template context that contains Django settings
|
||||
# values needed by admin map templates.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
from django.core import serializers
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.db.backends.mysql.base import DatabaseWrapper as MySQLDatabaseWrapper
|
||||
from django.db.backends.mysql.base import \
|
||||
DatabaseWrapper as MySQLDatabaseWrapper
|
||||
|
||||
from .creation import MySQLCreation
|
||||
from .features import DatabaseFeatures
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
|
||||
from django.db.backends.mysql.features import DatabaseFeatures as MySQLDatabaseFeatures
|
||||
from django.db.backends.mysql.features import \
|
||||
DatabaseFeatures as MySQLDatabaseFeatures
|
||||
|
||||
|
||||
class DatabaseFeatures(BaseSpatialFeatures, MySQLDatabaseFeatures):
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
|
||||
from django.contrib.gis.db.backends.base.operations import BaseSpatialOperations
|
||||
from django.contrib.gis.db.backends.base.operations import \
|
||||
BaseSpatialOperations
|
||||
from django.contrib.gis.db.backends.utils import SpatialOperator
|
||||
from django.contrib.gis.db.models import aggregates
|
||||
from django.db.backends.mysql.operations import DatabaseOperations
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import logging
|
||||
|
||||
from django.contrib.gis.db.models.fields import GeometryField
|
||||
from django.db.utils import OperationalError
|
||||
from django.db.backends.mysql.schema import DatabaseSchemaEditor
|
||||
from django.db.utils import OperationalError
|
||||
|
||||
logger = logging.getLogger('django.contrib.gis')
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from cx_Oracle import CLOB
|
||||
|
||||
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.db.backends.oracle.base import DatabaseWrapper as OracleDatabaseWrapper
|
||||
from django.db.backends.oracle.base import \
|
||||
DatabaseWrapper as OracleDatabaseWrapper
|
||||
|
||||
from .creation import OracleCreation
|
||||
from .features import DatabaseFeatures
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
|
||||
from django.db.backends.oracle.features import DatabaseFeatures as OracleDatabaseFeatures
|
||||
from django.db.backends.oracle.features import \
|
||||
DatabaseFeatures as OracleDatabaseFeatures
|
||||
|
||||
|
||||
class DatabaseFeatures(BaseSpatialFeatures, OracleDatabaseFeatures):
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import cx_Oracle
|
||||
import sys
|
||||
|
||||
import cx_Oracle
|
||||
|
||||
from django.db.backends.oracle.introspection import DatabaseIntrospection
|
||||
from django.utils import six
|
||||
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
"""
|
||||
import re
|
||||
|
||||
from django.contrib.gis.db.backends.base.operations import BaseSpatialOperations
|
||||
from django.contrib.gis.db.backends.base.operations import \
|
||||
BaseSpatialOperations
|
||||
from django.contrib.gis.db.backends.oracle.adapter import OracleSpatialAdapter
|
||||
from django.contrib.gis.db.backends.utils import SpatialOperator
|
||||
from django.contrib.gis.db.models import aggregates
|
||||
|
@ -19,7 +20,6 @@ from django.db.backends.oracle.base import Database
|
|||
from django.db.backends.oracle.operations import DatabaseOperations
|
||||
from django.utils import six
|
||||
|
||||
|
||||
DEFAULT_TOLERANCE = '0.05'
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
from django.conf import settings
|
||||
from django.db.backends.base.base import NO_DB_ALIAS
|
||||
from django.db.backends.postgresql_psycopg2.base import (
|
||||
DatabaseWrapper as Psycopg2DatabaseWrapper,
|
||||
)
|
||||
from django.db.backends.postgresql_psycopg2.base import \
|
||||
DatabaseWrapper as Psycopg2DatabaseWrapper
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
from .creation import PostGISCreation
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
|
||||
from django.db.backends.postgresql_psycopg2.features import (
|
||||
DatabaseFeatures as Psycopg2DatabaseFeatures,
|
||||
)
|
||||
from django.db.backends.postgresql_psycopg2.features import \
|
||||
DatabaseFeatures as Psycopg2DatabaseFeatures
|
||||
|
||||
|
||||
class DatabaseFeatures(BaseSpatialFeatures, Psycopg2DatabaseFeatures):
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection
|
||||
from django.contrib.gis.gdal import OGRGeomType
|
||||
from django.db.backends.postgresql_psycopg2.introspection import \
|
||||
DatabaseIntrospection
|
||||
|
||||
|
||||
class GeoIntrospectionError(Exception):
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"""
|
||||
The GeometryColumns and SpatialRefSys models for the PostGIS backend.
|
||||
"""
|
||||
from django.db import models
|
||||
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
import re
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.gis.db.backends.base.operations import BaseSpatialOperations
|
||||
from django.contrib.gis.db.backends.base.operations import \
|
||||
BaseSpatialOperations
|
||||
from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
|
||||
from django.contrib.gis.db.backends.utils import SpatialOperator
|
||||
from django.contrib.gis.geometry.backend import Geometry
|
||||
from django.contrib.gis.measure import Distance
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations
|
||||
from django.db.backends.postgresql_psycopg2.operations import \
|
||||
DatabaseOperations
|
||||
from django.db.utils import ProgrammingError
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django.db.backends.sqlite3.base import Database
|
||||
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
|
||||
from django.db.backends.sqlite3.base import Database
|
||||
|
||||
|
||||
class SpatiaLiteAdapter(WKTAdapter):
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
|
||||
from django.db.backends.sqlite3.features import DatabaseFeatures as SQLiteDatabaseFeatures
|
||||
from django.db.backends.sqlite3.features import \
|
||||
DatabaseFeatures as SQLiteDatabaseFeatures
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
from django.contrib.gis.gdal import OGRGeomType
|
||||
from django.db.backends.sqlite3.introspection import DatabaseIntrospection, FlexibleFieldLookupDict
|
||||
from django.db.backends.sqlite3.introspection import (
|
||||
DatabaseIntrospection, FlexibleFieldLookupDict,
|
||||
)
|
||||
from django.utils import six
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
"""
|
||||
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
|
||||
"""
|
||||
from django.db import connection, models
|
||||
from django.db.backends.signals import connection_created
|
||||
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
|
||||
from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper
|
||||
from django.db import connection, models
|
||||
from django.db.backends.signals import connection_created
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import re
|
||||
import sys
|
||||
|
||||
from django.contrib.gis.db.backends.base.operations import BaseSpatialOperations
|
||||
from django.contrib.gis.db.backends.utils import SpatialOperator
|
||||
from django.contrib.gis.db.backends.base.operations import \
|
||||
BaseSpatialOperations
|
||||
from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter
|
||||
from django.contrib.gis.db.backends.utils import SpatialOperator
|
||||
from django.contrib.gis.db.models import aggregates
|
||||
from django.contrib.gis.geometry.backend import Geometry
|
||||
from django.contrib.gis.measure import Distance
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django.db.utils import DatabaseError
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.utils import DatabaseError
|
||||
|
||||
|
||||
class SpatialiteSchemaEditor(DatabaseSchemaEditor):
|
||||
|
|
|
@ -7,4 +7,4 @@ warnings.warn(
|
|||
"Use django.contrib.gis.db.backends.utils instead.",
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
|
||||
from django.contrib.gis.db.backends.utils import * # NOQA
|
||||
from django.contrib.gis.db.backends.utils import * # NOQA isort:skip
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from django.db.models.aggregates import Aggregate
|
||||
from django.contrib.gis.db.models.fields import ExtentField
|
||||
from django.db.models.aggregates import Aggregate
|
||||
|
||||
__all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union']
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue