Sorted imports in __init__.py files.

This commit is contained in:
Tim Graham 2015-06-15 14:07:31 -04:00
parent 4a66a69239
commit 7da3923ba0
33 changed files with 189 additions and 173 deletions

View File

@ -1,2 +1,4 @@
from .config import AppConfig # NOQA from .config import AppConfig
from .registry import apps # NOQA from .registry import apps
__all__ = ['AppConfig', 'apps']

View File

@ -8,7 +8,7 @@ a list of all possible variables.
import importlib import importlib
import os import os
import time # Needed for Windows import time
import warnings import warnings
from django.conf import global_settings from django.conf import global_settings

View File

@ -1,9 +1,10 @@
from importlib import import_module
import warnings import warnings
from importlib import import_module
from django.core.urlresolvers import (RegexURLPattern,
RegexURLResolver, LocaleRegexURLResolver)
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import (
LocaleRegexURLResolver, RegexURLPattern, RegexURLResolver,
)
from django.utils import six from django.utils import six
from django.utils.deprecation import ( from django.utils.deprecation import (
RemovedInDjango20Warning, RemovedInDjango110Warning, RemovedInDjango20Warning, RemovedInDjango110Warning,

View File

@ -1,13 +1,15 @@
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # ACTION_CHECKBOX_NAME is unused, but should stay since its import from here
# has been referenced in documentation. # has been referenced in documentation.
from django.contrib.admin.decorators import register from django.contrib.admin.decorators import register
from django.contrib.admin.filters import (
AllValuesFieldListFilter, BooleanFieldListFilter, ChoicesFieldListFilter,
DateFieldListFilter, FieldListFilter, ListFilter, RelatedFieldListFilter,
RelatedOnlyFieldListFilter, SimpleListFilter,
)
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.options import (HORIZONTAL, VERTICAL, from django.contrib.admin.options import (
ModelAdmin, StackedInline, TabularInline) HORIZONTAL, VERTICAL, ModelAdmin, StackedInline, TabularInline,
from django.contrib.admin.filters import (ListFilter, SimpleListFilter, )
FieldListFilter, BooleanFieldListFilter, RelatedFieldListFilter,
ChoicesFieldListFilter, DateFieldListFilter, AllValuesFieldListFilter,
RelatedOnlyFieldListFilter)
from django.contrib.admin.sites import AdminSite, site from django.contrib.admin.sites import AdminSite, site
from django.utils.module_loading import autodiscover_modules from django.utils.module_loading import autodiscover_modules

View File

@ -11,8 +11,8 @@ from django.contrib.auth import get_permission_codename
from django.core import exceptions from django.core import exceptions
from django.core.management.base import CommandError from django.core.management.base import CommandError
from django.db import DEFAULT_DB_ALIAS, router from django.db import DEFAULT_DB_ALIAS, router
from django.utils.encoding import DEFAULT_LOCALE_ENCODING
from django.utils import six from django.utils import six
from django.utils.encoding import DEFAULT_LOCALE_ENCODING
def _get_all_permissions(opts, ctype): def _get_all_permissions(opts, ctype):

View File

@ -1,9 +1,7 @@
# Getting the normal admin routines, classes, and `site` instance.
from django.contrib.admin import ( from django.contrib.admin import (
autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline, HORIZONTAL, VERTICAL, AdminSite, ModelAdmin, StackedInline, TabularInline,
HORIZONTAL, VERTICAL, autodiscover, site,
) )
# Geographic admin options classes and widgets.
from django.contrib.gis.admin.options import GeoModelAdmin, OSMGeoAdmin from django.contrib.gis.admin.options import GeoModelAdmin, OSMGeoAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget from django.contrib.gis.admin.widgets import OpenLayersWidget

View File

@ -1,14 +1,8 @@
# Want to get everything from the 'normal' models package. from django.db.models import * # NOQA isort:skip
from django.db.models import * # NOQA
# Geographic aggregate functions
from django.contrib.gis.db.models.aggregates import * # NOQA from django.contrib.gis.db.models.aggregates import * # NOQA
# The GeoManager
from django.contrib.gis.db.models.manager import GeoManager # NOQA
# The geographic-enabled fields.
from django.contrib.gis.db.models.fields import ( # NOQA from django.contrib.gis.db.models.fields import ( # NOQA
GeometryField, PointField, LineStringField, PolygonField, GeometryCollectionField, GeometryField, LineStringField,
MultiPointField, MultiLineStringField, MultiPolygonField, MultiLineStringField, MultiPointField, MultiPolygonField, PointField,
GeometryCollectionField, RasterField) PolygonField, RasterField,
)
from django.contrib.gis.db.models.manager import GeoManager # NOQA

View File

@ -1,4 +1,6 @@
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField, GMLField from django.contrib.gis.db.models.sql.conversion import (
AreaField, DistanceField, GeomField, GMLField,
)
__all__ = [ __all__ = [
'AreaField', 'DistanceField', 'GeomField', 'GMLField' 'AreaField', 'DistanceField', 'GeomField', 'GMLField'

View File

@ -1,5 +1,8 @@
from django.forms import * # NOQA from django.forms import * # NOQA
from .fields import (GeometryField, GeometryCollectionField, PointField, # NOQA
MultiPointField, LineStringField, MultiLineStringField, PolygonField, from .fields import ( # NOQA
MultiPolygonField) GeometryCollectionField, GeometryField, LineStringField,
MultiLineStringField, MultiPointField, MultiPolygonField, PointField,
PolygonField,
)
from .widgets import BaseGeometryWidget, OpenLayersWidget, OSMWidget # NOQA from .widgets import BaseGeometryWidget, OpenLayersWidget, OSMWidget # NOQA

View File

@ -31,8 +31,9 @@
to a non-existent file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`; to a non-existent file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`;
setting to None/False/'' will not work as a string must be given). setting to None/False/'' will not work as a string must be given).
""" """
from django.contrib.gis.gdal.error import (check_err, GDALException, from django.contrib.gis.gdal.error import ( # NOQA
OGRException, OGRIndexError, SRSException) # NOQA GDALException, OGRException, OGRIndexError, SRSException, check_err,
)
from django.contrib.gis.gdal.geomtype import OGRGeomType # NOQA from django.contrib.gis.gdal.geomtype import OGRGeomType # NOQA
__all__ = [ __all__ = [

View File

@ -2,13 +2,15 @@
The GeoDjango GEOS module. Please consult the GeoDjango documentation The GeoDjango GEOS module. Please consult the GeoDjango documentation
for more details: https://docs.djangoproject.com/en/dev/ref/contrib/gis/geos/ for more details: https://docs.djangoproject.com/en/dev/ref/contrib/gis/geos/
""" """
from .collections import GeometryCollection, MultiPoint, MultiLineString, MultiPolygon # NOQA from .collections import ( # NOQA
GeometryCollection, MultiLineString, MultiPoint, MultiPolygon,
)
from .error import GEOSException, GEOSIndexError # NOQA from .error import GEOSException, GEOSIndexError # NOQA
from .factory import fromfile, fromstr # NOQA from .factory import fromfile, fromstr # NOQA
from .geometry import GEOSGeometry, wkt_regex, hex_regex # NOQA from .geometry import GEOSGeometry, hex_regex, wkt_regex # NOQA
from .io import WKTReader, WKTWriter, WKBReader, WKBWriter # NOQA from .io import WKBReader, WKBWriter, WKTReader, WKTWriter # NOQA
from .libgeos import geos_version, geos_version_info # NOQA from .libgeos import geos_version, geos_version_info # NOQA
from .linestring import LineString, LinearRing # NOQA from .linestring import LinearRing, LineString # NOQA
from .point import Point # NOQA from .point import Point # NOQA
from .polygon import Polygon # NOQA from .polygon import Polygon # NOQA

View File

@ -4,27 +4,21 @@
via ctypes. via ctypes.
""" """
# Coordinate sequence routines. from django.contrib.gis.geos.prototypes.coordseq import ( # NOQA
from django.contrib.gis.geos.prototypes.coordseq import (create_cs, get_cs, # NOQA create_cs, cs_clone, cs_getdims, cs_getordinate, cs_getsize, cs_getx,
cs_clone, cs_getordinate, cs_setordinate, cs_getx, cs_gety, cs_getz, cs_gety, cs_getz, cs_setordinate, cs_setx, cs_sety, cs_setz, get_cs,
cs_setx, cs_sety, cs_setz, cs_getsize, cs_getdims) )
from django.contrib.gis.geos.prototypes.geom import ( # NOQA
# Geometry routines. create_collection, create_linearring, create_linestring, create_point,
from django.contrib.gis.geos.prototypes.geom import (from_hex, from_wkb, from_wkt, # NOQA create_polygon, destroy_geom, from_hex, from_wkb, from_wkt, geom_clone,
create_point, create_linestring, create_linearring, create_polygon, create_collection, geos_get_srid, geos_normalize, geos_set_srid, geos_type, geos_typeid,
destroy_geom, get_extring, get_intring, get_nrings, get_geomn, geom_clone, get_dims, get_extring, get_geomn, get_intring, get_nrings, get_num_coords,
geos_normalize, geos_type, geos_typeid, geos_get_srid, geos_set_srid, get_num_geoms, to_hex, to_wkb, to_wkt,
get_dims, get_num_coords, get_num_geoms, )
to_hex, to_wkb, to_wkt)
# Miscellaneous routines.
from django.contrib.gis.geos.prototypes.misc import * # NOQA from django.contrib.gis.geos.prototypes.misc import * # NOQA
from django.contrib.gis.geos.prototypes.predicates import ( # NOQA
# Predicates geos_contains, geos_crosses, geos_disjoint, geos_equals, geos_equalsexact,
from django.contrib.gis.geos.prototypes.predicates import (geos_hasz, geos_isempty, # NOQA geos_hasz, geos_intersects, geos_isempty, geos_isring, geos_issimple,
geos_isring, geos_issimple, geos_isvalid, geos_contains, geos_crosses, geos_isvalid, geos_overlaps, geos_relatepattern, geos_touches, geos_within,
geos_disjoint, geos_equals, geos_equalsexact, geos_intersects, )
geos_overlaps, geos_relatepattern, geos_touches, geos_within)
# Topology routines
from django.contrib.gis.geos.prototypes.topology import * # NOQA from django.contrib.gis.geos.prototypes.topology import * # NOQA

View File

@ -58,7 +58,9 @@
version. version.
""" """
from django.contrib.gis.maps.google.gmap import GoogleMap, GoogleMapSet from django.contrib.gis.maps.google.gmap import GoogleMap, GoogleMapSet
from django.contrib.gis.maps.google.overlays import GEvent, GIcon, GMarker, GPolygon, GPolyline from django.contrib.gis.maps.google.overlays import (
GEvent, GIcon, GMarker, GPolygon, GPolyline,
)
from django.contrib.gis.maps.google.zoom import GoogleZoom from django.contrib.gis.maps.google.zoom import GoogleZoom
__all__ = [ __all__ = [

View File

@ -1,8 +1,9 @@
""" """
This module contains useful utilities for GeoDjango. This module contains useful utilities for GeoDjango.
""" """
# Importing the utilities that depend on GDAL, if available.
from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.utils.wkt import precision_wkt # NOQA
if HAS_GDAL: if HAS_GDAL:
from django.contrib.gis.utils.ogrinfo import ogrinfo, sample # NOQA from django.contrib.gis.utils.ogrinfo import ogrinfo, sample # NOQA
from django.contrib.gis.utils.ogrinspect import mapping, ogrinspect # NOQA from django.contrib.gis.utils.ogrinspect import mapping, ogrinspect # NOQA
@ -14,5 +15,3 @@ if HAS_GDAL:
from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError # NOQA from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError # NOQA
except ImproperlyConfigured: except ImproperlyConfigured:
pass pass
from django.contrib.gis.utils.wkt import precision_wkt # NOQA

View File

@ -1,12 +1,11 @@
from django.apps import apps as django_apps from django.apps import apps as django_apps
from django.conf import settings from django.conf import settings
from django.core import urlresolvers, paginator from django.core import paginator, urlresolvers
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.utils import translation from django.utils import translation
from django.utils.six.moves.urllib.parse import urlencode from django.utils.six.moves.urllib.parse import urlencode
from django.utils.six.moves.urllib.request import urlopen from django.utils.six.moves.urllib.request import urlopen
PING_URL = "http://www.google.com/webmasters/tools/ping" PING_URL = "http://www.google.com/webmasters/tools/ping"

View File

@ -2,6 +2,7 @@ import warnings
from django.utils.deprecation import RemovedInDjango110Warning from django.utils.deprecation import RemovedInDjango110Warning
default_app_config = 'django.contrib.webdesign.apps.WebDesignConfig' default_app_config = 'django.contrib.webdesign.apps.WebDesignConfig'
warnings.warn( warnings.warn(

View File

@ -17,11 +17,11 @@ from threading import local
from django.conf import settings from django.conf import settings
from django.core import signals from django.core import signals
from django.core.cache.backends.base import ( from django.core.cache.backends.base import (
InvalidCacheBackendError, CacheKeyWarning, BaseCache) BaseCache, CacheKeyWarning, InvalidCacheBackendError,
)
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.utils.module_loading import import_string from django.utils.module_loading import import_string
__all__ = [ __all__ = [
'cache', 'DEFAULT_CACHE_ALIAS', 'InvalidCacheBackendError', 'cache', 'DEFAULT_CACHE_ALIAS', 'InvalidCacheBackendError',
'CacheKeyWarning', 'BaseCache', 'CacheKeyWarning', 'BaseCache',

View File

@ -1,17 +1,18 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from .messages import (CheckMessage, from .messages import (
Debug, Info, Warning, Error, Critical, CRITICAL, DEBUG, ERROR, INFO, WARNING, CheckMessage, Critical, Debug,
DEBUG, INFO, WARNING, ERROR, CRITICAL) Error, Info, Warning,
from .registry import register, run_checks, tag_exists, Tags )
from .registry import Tags, register, run_checks, tag_exists
# Import these to force registration of checks # Import these to force registration of checks
import django.core.checks.model_checks # NOQA import django.core.checks.model_checks # NOQA isort:skip
import django.core.checks.security.base # NOQA import django.core.checks.security.base # NOQA isort:skip
import django.core.checks.security.csrf # NOQA import django.core.checks.security.csrf # NOQA isort:skip
import django.core.checks.security.sessions # NOQA import django.core.checks.security.sessions # NOQA isort:skip
import django.core.checks.templates # NOQA import django.core.checks.templates # NOQA isort:skip
__all__ = [ __all__ = [
'CheckMessage', 'CheckMessage',

View File

@ -4,18 +4,17 @@ Tools for sending email.
from __future__ import unicode_literals from __future__ import unicode_literals
from django.conf import settings from django.conf import settings
from django.utils.module_loading import import_string # Imported for backwards compatibility and for the sake
# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be in # of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the introduction of email # django/core/mail.py before the introduction of email
# backends and the subsequent reorganization (See #10355) # backends and the subsequent reorganization (See #10355)
from django.core.mail.utils import CachedDnsName, DNS_NAME
from django.core.mail.message import ( from django.core.mail.message import (
EmailMessage, EmailMultiAlternatives, DEFAULT_ATTACHMENT_MIME_TYPE, BadHeaderError, EmailMessage,
SafeMIMEText, SafeMIMEMultipart, EmailMultiAlternatives, SafeMIMEMultipart, SafeMIMEText,
DEFAULT_ATTACHMENT_MIME_TYPE, make_msgid, forbid_multi_line_headers, make_msgid,
BadHeaderError, forbid_multi_line_headers) )
from django.core.mail.utils import DNS_NAME, CachedDnsName
from django.utils.module_loading import import_string
__all__ = [ __all__ = [
'CachedDnsName', 'DNS_NAME', 'EmailMessage', 'EmailMultiAlternatives', 'CachedDnsName', 'DNS_NAME', 'EmailMessage', 'EmailMultiAlternatives',

View File

@ -1,17 +1,18 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import collections import collections
from importlib import import_module
import os import os
import pkgutil import pkgutil
import sys import sys
from importlib import import_module
import django import django
from django.apps import apps from django.apps import apps
from django.conf import settings from django.conf import settings
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import (BaseCommand, CommandError, from django.core.management.base import (
CommandParser, handle_default_options) BaseCommand, CommandError, CommandParser, handle_default_options,
)
from django.core.management.color import color_style from django.core.management.color import color_style
from django.utils import lru_cache, six from django.utils import lru_cache, six
from django.utils._os import npath, upath from django.utils._os import npath, upath

View File

@ -20,8 +20,8 @@ import importlib
from django.apps import apps from django.apps import apps
from django.conf import settings from django.conf import settings
from django.utils import six
from django.core.serializers.base import SerializerDoesNotExist from django.core.serializers.base import SerializerDoesNotExist
from django.utils import six
# Built-in serializers # Built-in serializers
BUILTIN_SERIALIZERS = { BUILTIN_SERIALIZERS = {

View File

@ -1,9 +1,10 @@
from django.core import signals from django.core import signals
from django.db.utils import (DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY, from django.db.utils import (
DataError, OperationalError, IntegrityError, InternalError, ProgrammingError, DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY, ConnectionHandler,
NotSupportedError, DatabaseError, InterfaceError, Error, ConnectionHandler, ConnectionRouter, DatabaseError, DataError, Error, IntegrityError,
ConnectionRouter) InterfaceError, InternalError, NotSupportedError, OperationalError,
ProgrammingError,
)
__all__ = [ __all__ = [
'backend', 'connection', 'connections', 'router', 'DatabaseError', 'backend', 'connection', 'connections', 'router', 'DatabaseError',

View File

@ -1,8 +1,10 @@
from .models import (CreateModel, DeleteModel, AlterModelTable, from .fields import AddField, AlterField, RemoveField, RenameField
AlterUniqueTogether, AlterIndexTogether, RenameModel, AlterModelOptions, from .models import (
AlterOrderWithRespectTo, AlterModelManagers) AlterIndexTogether, AlterModelManagers, AlterModelOptions, AlterModelTable,
from .fields import AddField, RemoveField, AlterField, RenameField AlterOrderWithRespectTo, AlterUniqueTogether, CreateModel, DeleteModel,
from .special import SeparateDatabaseAndState, RunSQL, RunPython RenameModel,
)
from .special import RunPython, RunSQL, SeparateDatabaseAndState
__all__ = [ __all__ = [
'CreateModel', 'DeleteModel', 'AlterModelTable', 'AlterUniqueTogether', 'CreateModel', 'DeleteModel', 'AlterModelTable', 'AlterUniqueTogether',

View File

@ -1,24 +1,28 @@
from functools import wraps from functools import wraps
from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured # NOQA from django.core.exceptions import ObjectDoesNotExist # NOQA
from django.db.models.query import Q, QuerySet, Prefetch # NOQA
from django.db.models.expressions import ( # NOQA
Expression, ExpressionWrapper, F, Value, Func, Case, When,
)
from django.db.models.manager import Manager # NOQA
from django.db.models.base import Model # NOQA
from django.db.models.aggregates import * # NOQA
from django.db.models.fields import * # NOQA
from django.db.models.fields.subclassing import SubfieldBase # NOQA
from django.db.models.fields.files import FileField, ImageField # NOQA
from django.db.models.fields.related import ( # NOQA
ForeignKey, ForeignObject, OneToOneField, ManyToManyField,
ManyToOneRel, ManyToManyRel, OneToOneRel)
from django.db.models.fields.proxy import OrderWrt # NOQA
from django.db.models.deletion import ( # NOQA
CASCADE, PROTECT, SET, SET_NULL, SET_DEFAULT, DO_NOTHING, ProtectedError)
from django.db.models.lookups import Lookup, Transform # NOQA
from django.db.models import signals # NOQA from django.db.models import signals # NOQA
from django.db.models.aggregates import * # NOQA
from django.db.models.deletion import ( # NOQA
CASCADE, DO_NOTHING, PROTECT, SET, SET_DEFAULT, SET_NULL, ProtectedError,
)
from django.db.models.expressions import ( # NOQA
F, Case, Expression, ExpressionWrapper, Func, Value, When,
)
from django.db.models.fields import * # NOQA
from django.db.models.fields.files import FileField, ImageField # NOQA
from django.db.models.fields.proxy import OrderWrt # NOQA
from django.db.models.fields.subclassing import SubfieldBase # NOQA
from django.db.models.lookups import Lookup, Transform # NOQA
from django.db.models.manager import Manager # NOQA
from django.db.models.query import Q, Prefetch, QuerySet # NOQA
# Imports that would create circular imports if sorted
from django.db.models.base import Model # NOQA isort:skip
from django.db.models.fields.related import ( # NOQA isort:skip
ForeignKey, ForeignObject, OneToOneField, ManyToManyField,
ManyToOneRel, ManyToManyRel, OneToOneRel,
)
def permalink(func): def permalink(func):

View File

@ -11,31 +11,34 @@ import warnings
from base64 import b64decode, b64encode from base64 import b64decode, b64encode
from functools import total_ordering from functools import total_ordering
from django.apps import apps
from django.db import connection
from django.db.models.lookups import default_lookups, RegisterLookupMixin, Transform, Lookup
from django.db.models.query_utils import QueryWrapper
from django.conf import settings
from django import forms from django import forms
from django.core import exceptions, validators, checks from django.apps import apps
from django.utils.datastructures import DictWrapper from django.conf import settings
from django.utils.dateparse import parse_date, parse_datetime, parse_time, parse_duration from django.core import checks, exceptions, validators
from django.utils.duration import duration_string
from django.utils.functional import cached_property, curry, Promise
from django.utils.text import capfirst
from django.utils import timezone
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import (smart_text, force_text, force_bytes,
python_2_unicode_compatible)
from django.utils.ipv6 import clean_ipv6_address
from django.utils import six
from django.utils.itercompat import is_iterable
# When the _meta object was formalized, this exception was moved to # When the _meta object was formalized, this exception was moved to
# django.core.exceptions. It is retained here for backwards compatibility # django.core.exceptions. It is retained here for backwards compatibility
# purposes. # purposes.
from django.core.exceptions import FieldDoesNotExist # NOQA from django.core.exceptions import FieldDoesNotExist # NOQA
from django.db import connection
from django.db.models.lookups import (
Lookup, RegisterLookupMixin, Transform, default_lookups,
)
from django.db.models.query_utils import QueryWrapper
from django.utils import six, timezone
from django.utils.datastructures import DictWrapper
from django.utils.dateparse import (
parse_date, parse_datetime, parse_duration, parse_time,
)
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.duration import duration_string
from django.utils.encoding import (
force_bytes, force_text, python_2_unicode_compatible, smart_text,
)
from django.utils.functional import Promise, cached_property, curry
from django.utils.ipv6 import clean_ipv6_address
from django.utils.itercompat import is_iterable
from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
# Avoid "TypeError: Item in ``from list'' not a string" -- unicode_literals # Avoid "TypeError: Item in ``from list'' not a string" -- unicode_literals
# makes these strings unicode # makes these strings unicode

View File

@ -1,7 +1,6 @@
from django.db.models.sql.datastructures import EmptyResultSet from django.db.models.sql.datastructures import EmptyResultSet
from django.db.models.sql.subqueries import * # NOQA
from django.db.models.sql.query import * # NOQA from django.db.models.sql.query import * # NOQA
from django.db.models.sql.subqueries import * # NOQA
from django.db.models.sql.where import AND, OR from django.db.models.sql.where import AND, OR
__all__ = ['Query', 'AND', 'OR', 'EmptyResultSet'] __all__ = ['Query', 'AND', 'OR', 'EmptyResultSet']

View File

@ -1,12 +1,14 @@
from django.http.cookie import SimpleCookie, parse_cookie from django.http.cookie import SimpleCookie, parse_cookie
from django.http.request import (HttpRequest, QueryDict, from django.http.request import (
RawPostDataException, UnreadablePostError, build_request_repr) HttpRequest, QueryDict, RawPostDataException, UnreadablePostError,
build_request_repr,
)
from django.http.response import ( from django.http.response import (
HttpResponse, StreamingHttpResponse, FileResponse, BadHeaderError, FileResponse, Http404, HttpResponse,
HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseGone,
HttpResponseNotModified, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed, HttpResponseNotFound, HttpResponseNotModified,
HttpResponseNotFound, HttpResponseNotAllowed, HttpResponseGone, HttpResponsePermanentRedirect, HttpResponseRedirect,
HttpResponseServerError, Http404, BadHeaderError, JsonResponse, HttpResponseServerError, JsonResponse, StreamingHttpResponse,
) )
from django.http.utils import conditional_content_removal from django.http.utils import conditional_content_removal

View File

@ -42,10 +42,8 @@ Shared:
# Multiple Template Engines # Multiple Template Engines
from .engine import Engine from .engine import Engine
from .utils import EngineHandler from .utils import EngineHandler
engines = EngineHandler() engines = EngineHandler()
__all__ = ('Engine', 'engines') __all__ = ('Engine', 'engines')
@ -54,19 +52,20 @@ __all__ = ('Engine', 'engines')
# Django Template Language # Django Template Language
# Public exceptions # Public exceptions
from .base import VariableDoesNotExist # NOQA from .base import VariableDoesNotExist # NOQA isort:skip
from .context import ContextPopException # NOQA from .context import ContextPopException # NOQA isort:skip
from .exceptions import TemplateDoesNotExist, TemplateSyntaxError # NOQA from .exceptions import TemplateDoesNotExist, TemplateSyntaxError # NOQA isort:skip
# Template parts # Template parts
from .base import (Context, Node, NodeList, Origin, RequestContext, # NOQA from .base import ( # NOQA isort:skip
Template, Variable) Context, Node, NodeList, Origin, RequestContext, Template, Variable,
)
# Deprecated in Django 1.8, will be removed in Django 1.10. # Deprecated in Django 1.8, will be removed in Django 1.10.
from .base import resolve_variable # NOQA from .base import resolve_variable # NOQA isort:skip
# Library management # Library management
from .library import Library # NOQA from .library import Library # NOQA isort:skip
__all__ += ('Template', 'Context', 'RequestContext') __all__ += ('Template', 'Context', 'RequestContext')

View File

@ -4,12 +4,13 @@ Django Unit Test and Doctest framework.
from django.test.client import Client, RequestFactory from django.test.client import Client, RequestFactory
from django.test.testcases import ( from django.test.testcases import (
TestCase, TransactionTestCase, LiveServerTestCase, SimpleTestCase, TestCase, TransactionTestCase,
SimpleTestCase, LiveServerTestCase, skipIfDBFeature, skipIfDBFeature, skipUnlessAnyDBFeature, skipUnlessDBFeature,
skipUnlessAnyDBFeature, skipUnlessDBFeature )
from django.test.utils import (
ignore_warnings, modify_settings, override_settings,
override_system_checks,
) )
from django.test.utils import (ignore_warnings, modify_settings,
override_settings, override_system_checks)
__all__ = [ __all__ = [
'Client', 'RequestFactory', 'TestCase', 'TransactionTestCase', 'Client', 'RequestFactory', 'TestCase', 'TransactionTestCase',

View File

@ -2,12 +2,13 @@
Internationalization support. Internationalization support.
""" """
from __future__ import unicode_literals from __future__ import unicode_literals
import re import re
from django.utils import six
from django.utils.decorators import ContextDecorator from django.utils.decorators import ContextDecorator
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.functional import lazy from django.utils.functional import lazy
from django.utils import six
__all__ = [ __all__ = [
'activate', 'deactivate', 'override', 'deactivate_all', 'activate', 'deactivate', 'override', 'deactivate_all',

View File

@ -1,12 +1,14 @@
from django.views.generic.base import View, TemplateView, RedirectView from django.views.generic.base import RedirectView, TemplateView, View
from django.views.generic.dates import (ArchiveIndexView, YearArchiveView, MonthArchiveView, from django.views.generic.dates import (
WeekArchiveView, DayArchiveView, TodayArchiveView, ArchiveIndexView, DateDetailView, DayArchiveView, MonthArchiveView,
DateDetailView) TodayArchiveView, WeekArchiveView, YearArchiveView,
)
from django.views.generic.detail import DetailView from django.views.generic.detail import DetailView
from django.views.generic.edit import FormView, CreateView, UpdateView, DeleteView from django.views.generic.edit import (
CreateView, DeleteView, FormView, UpdateView,
)
from django.views.generic.list import ListView from django.views.generic.list import ListView
__all__ = [ __all__ = [
'View', 'TemplateView', 'RedirectView', 'ArchiveIndexView', 'View', 'TemplateView', 'RedirectView', 'ArchiveIndexView',
'YearArchiveView', 'MonthArchiveView', 'WeekArchiveView', 'DayArchiveView', 'YearArchiveView', 'MonthArchiveView', 'WeekArchiveView', 'DayArchiveView',

View File

@ -13,6 +13,7 @@ default_section = THIRDPARTY
include_trailing_comma = true include_trailing_comma = true
known_first_party = django known_first_party = django
multi_line_output = 5 multi_line_output = 5
not_skip = __init__.py
[metadata] [metadata]
license-file = LICENSE license-file = LICENSE

View File

@ -1,11 +1,11 @@
from .custom_permissions import CustomPermissionsUser from .custom_permissions import CustomPermissionsUser
from .is_active import IsActiveTestUser1
from .invalid_models import ( from .invalid_models import (
CustomUserNonUniqueUsername, CustomUserNonListRequiredFields, CustomUserBadRequiredFields, CustomUserNonListRequiredFields,
CustomUserBadRequiredFields, CustomUserNonUniqueUsername,
) )
from .with_foreign_key import CustomUserWithFK, Email from .is_active import IsActiveTestUser1
from .uuid_pk import UUIDUser from .uuid_pk import UUIDUser
from .with_foreign_key import CustomUserWithFK, Email
__all__ = ( __all__ = (
'CustomPermissionsUser', 'CustomUserNonUniqueUsername', 'CustomPermissionsUser', 'CustomUserNonUniqueUsername',