Ticket #16225: 16225.2.diff

File 16225.2.diff, 132.4 KB (added by Jannis Leidel, 13 years ago)

Updated patch for r16387.

  • django/bin/profiling/gather_profile_stats.py

    diff --git a/django/bin/profiling/gather_profile_stats.py b/django/bin/profiling/gather_profile_stats.py
    index 0fd2b7f..2274ead 100644
    a b hotshot.stats (the formats are incompatible)  
    88"""
    99
    1010from hotshot import stats
     11import os
    1112import pstats
    12 import sys, os
     13import sys
    1314
    1415def gather_stats(p):
    1516    profiles = {}
  • django/contrib/admin/templatetags/admin_list.py

    diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py
    index c74657a..e07414b 100644
    a b import datetime  
    33from django.conf import settings
    44from django.contrib.admin.util import lookup_field, display_for_field, label_for_field
    55from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE,
    6     ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR)
     6    ORDER_VAR, PAGE_VAR, SEARCH_VAR)
    77from django.core.exceptions import ObjectDoesNotExist
    88from django.db import models
    99from django.utils import formats
    10 from django.utils.datastructures import SortedDict
    1110from django.utils.html import escape, conditional_escape
    1211from django.utils.safestring import mark_safe
    1312from django.utils.text import capfirst
  • django/contrib/admin/views/main.py

    diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py
    index aea656f..d7adc48 100644
    a b MAX_SHOW_ALL_ALLOWED = 200  
    1919# Changelist settings
    2020ALL_VAR = 'all'
    2121ORDER_VAR = 'o'
    22 ORDER_TYPE_VAR = 'ot'
    2322PAGE_VAR = 'p'
    2423SEARCH_VAR = 'q'
    2524TO_FIELD_VAR = 't'
    2625IS_POPUP_VAR = 'pop'
    2726ERROR_FLAG = 'e'
    2827
    29 IGNORED_PARAMS = (
    30     ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR, TO_FIELD_VAR)
     28IGNORED_PARAMS = (ALL_VAR, ORDER_VAR, SEARCH_VAR, IS_POPUP_VAR, TO_FIELD_VAR)
    3129
    3230# Text to display within change-list table cells if the value is blank.
    3331EMPTY_CHANGELIST_VALUE = ugettext_lazy('(None)')
  • django/contrib/admindocs/views.py

    diff --git a/django/contrib/admindocs/views.py b/django/contrib/admindocs/views.py
    index 319b489..a1d6b9b 100644
    a b  
    1 from django import template, templatetags
     1import inspect
     2import os
     3import re
     4
     5from django import template
    26from django.template import RequestContext
    37from django.conf import settings
    48from django.contrib.admin.views.decorators import staff_member_required
    from django.contrib.sites.models import Site  
    1216from django.utils.importlib import import_module
    1317from django.utils.translation import ugettext as _
    1418from django.utils.safestring import mark_safe
    15 import inspect, os, re
    1619
    1720# Exclude methods starting with these strings from documentation
    1821MODEL_METHODS_EXCLUDE = ('_', 'add_', 'delete', 'save', 'set_')
  • django/contrib/auth/__init__.py

    diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py
    index f11f830..141cac7 100644
    a b  
    1 import datetime
    21from warnings import warn
    32from django.core.exceptions import ImproperlyConfigured
    43from django.utils.importlib import import_module
  • django/contrib/auth/backends.py

    diff --git a/django/contrib/auth/backends.py b/django/contrib/auth/backends.py
    index d8c8140..fc751c7 100644
    a b  
    1 from django.db import connection
    21from django.contrib.auth.models import User, Permission
    32
    43
  • django/contrib/auth/management/__init__.py

    diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py
    index 9966849..f82060e 100644
    a b def get_default_username(check_db=True):  
    102102    :returns: The username, or an empty string if no username can be
    103103        determined.
    104104    """
    105     from django.contrib.auth.management.commands.createsuperuser import \
    106         RE_VALID_USERNAME
     105    from django.contrib.auth.management.commands.createsuperuser import (
     106        RE_VALID_USERNAME)
    107107    default_username = get_system_username()
    108108    try:
    109109        default_username = unicodedata.normalize('NFKD', default_username)\
  • django/contrib/auth/tests/auth_backends.py

    diff --git a/django/contrib/auth/tests/auth_backends.py b/django/contrib/auth/tests/auth_backends.py
    index 63b65ad..5163943 100644
    a b  
    1 import warnings
    2 
    31from django.conf import settings
    42from django.contrib.auth.models import User, Group, Permission, AnonymousUser
    53from django.contrib.contenttypes.models import ContentType
  • django/contrib/auth/tests/tokens.py

    diff --git a/django/contrib/auth/tests/tokens.py b/django/contrib/auth/tests/tokens.py
    index 9211e06..f7fc32e 100644
    a b  
    11from datetime import date, timedelta
    22
    33from django.conf import settings
    4 from django.contrib.auth.models import User, AnonymousUser
     4from django.contrib.auth.models import User
    55from django.contrib.auth.tokens import PasswordResetTokenGenerator
    66from django.test import TestCase
    77
  • django/contrib/formtools/preview.py

    diff --git a/django/contrib/formtools/preview.py b/django/contrib/formtools/preview.py
    index b4cdeba..d2e6987 100644
    a b  
    22Formtools Preview application.
    33"""
    44
    5 try:
    6     import cPickle as pickle
    7 except ImportError:
    8     import pickle
    9 
    10 from django.conf import settings
    115from django.http import Http404
    126from django.shortcuts import render_to_response
    137from django.template.context import RequestContext
  • django/contrib/formtools/utils.py

    diff --git a/django/contrib/formtools/utils.py b/django/contrib/formtools/utils.py
    index 4489506..3c0f7db 100644
    a b except ImportError:  
    55
    66import hashlib
    77from django.conf import settings
    8 from django.forms import BooleanField
    98from django.utils.crypto import salted_hmac
    109
    1110
  • django/contrib/formtools/wizard/storage/session.py

    diff --git a/django/contrib/formtools/wizard/storage/session.py b/django/contrib/formtools/wizard/storage/session.py
    index 84a3848..9cfae50 100644
    a b  
    1 from django.core.files.uploadedfile import UploadedFile
    21from django.contrib.formtools.wizard import storage
    32
    43
  • django/contrib/formtools/wizard/views.py

    diff --git a/django/contrib/formtools/wizard/views.py b/django/contrib/formtools/wizard/views.py
    index ac9cfbd..925e16f 100644
    a b  
    1 import copy
    21import re
    32
    43from django import forms
  • django/contrib/gis/admin/options.py

    diff --git a/django/contrib/gis/admin/options.py b/django/contrib/gis/admin/options.py
    index 8e1faf2..1014cb3 100644
    a b  
    1 from django.conf import settings
    21from django.contrib.admin import ModelAdmin
    32from django.contrib.gis.admin.widgets import OpenLayersWidget
    43from django.contrib.gis.gdal import OGRGeomType
  • django/contrib/gis/db/backends/base.py

    diff --git a/django/contrib/gis/db/backends/base.py b/django/contrib/gis/db/backends/base.py
    index 0eaacae..2a62d97 100644
    a b Base/mixin classes for the spatial backend database operations and the  
    33`SpatialRefSys` model the backend.
    44"""
    55import re
    6 from django.conf import settings
    76from django.contrib.gis import gdal
    87
    98class BaseSpatialOperations(object):
  • django/contrib/gis/db/backends/oracle/models.py

    diff --git a/django/contrib/gis/db/backends/oracle/models.py b/django/contrib/gis/db/backends/oracle/models.py
    index de757ff..ed29f7b 100644
    a b  
    88 model and the `SDO_COORD_REF_SYS` is used for the SpatialRefSys model.
    99"""
    1010from django.contrib.gis.db import models
    11 from django.contrib.gis.db.models.fields import GeometryField
    1211from django.contrib.gis.db.backends.base import SpatialRefSysMixin
    1312
    1413class GeometryColumns(models.Model):
  • django/contrib/gis/db/backends/spatialite/base.py

    diff --git a/django/contrib/gis/db/backends/spatialite/base.py b/django/contrib/gis/db/backends/spatialite/base.py
    index 729fc15..50467fc 100644
    a b from django.conf import settings  
    33
    44from django.core.exceptions import ImproperlyConfigured
    55from django.db.backends.sqlite3.base import *
    6 from django.db.backends.sqlite3.base import DatabaseWrapper as SqliteDatabaseWrapper, \
    7     _sqlite_extract, _sqlite_date_trunc, _sqlite_regexp
     6from django.db.backends.sqlite3.base import DatabaseWrapper as SqliteDatabaseWrapper
     7from django.db.backends.sqlite3.base import _sqlite_extract, _sqlite_date_trunc, _sqlite_regexp
    88from django.contrib.gis.db.backends.spatialite.client import SpatiaLiteClient
    99from django.contrib.gis.db.backends.spatialite.creation import SpatiaLiteCreation
    1010from django.contrib.gis.db.backends.spatialite.introspection import SpatiaLiteIntrospection
  • django/contrib/gis/db/models/__init__.py

    diff --git a/django/contrib/gis/db/models/__init__.py b/django/contrib/gis/db/models/__init__.py
    index 87e2b68..e36aa36 100644
    a b from django.contrib.gis.db.models.aggregates import *  
    88from django.contrib.gis.db.models.manager import GeoManager
    99
    1010# The geographic-enabled fields.
    11 from django.contrib.gis.db.models.fields import \
    12      GeometryField, PointField, LineStringField, PolygonField, \
    13      MultiPointField, MultiLineStringField, MultiPolygonField, \
    14      GeometryCollectionField
     11from django.contrib.gis.db.models.fields import (
     12     GeometryField, PointField, LineStringField, PolygonField,
     13     MultiPointField, MultiLineStringField, MultiPolygonField,
     14     GeometryCollectionField)
  • django/contrib/gis/db/models/query.py

    diff --git a/django/contrib/gis/db/models/query.py b/django/contrib/gis/db/models/query.py
    index 4df1a3a..c1e360d 100644
    a b  
    11from django.db import connections
    2 from django.db.models.query import QuerySet, Q, ValuesQuerySet, ValuesListQuerySet
     2from django.db.models.query import QuerySet, ValuesQuerySet, ValuesListQuerySet
    33
    44from django.contrib.gis.db.models import aggregates
    5 from django.contrib.gis.db.models.fields import get_srid_info, GeometryField, PointField, LineStringField
    6 from django.contrib.gis.db.models.sql import AreaField, DistanceField, GeomField, GeoQuery, GeoWhereNode
     5from django.contrib.gis.db.models.fields import get_srid_info, PointField, LineStringField
     6from django.contrib.gis.db.models.sql import AreaField, DistanceField, GeomField, GeoQuery
    77from django.contrib.gis.geometry.backend import Geometry
    88from django.contrib.gis.measure import Area, Distance
    99
  • django/contrib/gis/db/models/sql/aggregates.py

    diff --git a/django/contrib/gis/db/models/sql/aggregates.py b/django/contrib/gis/db/models/sql/aggregates.py
    index fed2a2e..9fcbb51 100644
    a b  
    11from django.db.models.sql.aggregates import *
    22from django.contrib.gis.db.models.fields import GeometryField
    3 from django.contrib.gis.db.models.sql.conversion import GeomField
    43
    54class GeoAggregate(Aggregate):
    65    # Default SQL template for spatial aggregates.
  • django/contrib/gis/db/models/sql/where.py

    diff --git a/django/contrib/gis/db/models/sql/where.py b/django/contrib/gis/db/models/sql/where.py
    index 17c210b..0e15222 100644
    a b  
    1 from django.db.models.fields import Field, FieldDoesNotExist
     1from django.db.models.fields import FieldDoesNotExist
    22from django.db.models.sql.constants import LOOKUP_SEP
    33from django.db.models.sql.expressions import SQLEvaluator
    44from django.db.models.sql.where import Constraint, WhereNode
  • django/contrib/gis/feeds.py

    diff --git a/django/contrib/gis/feeds.py b/django/contrib/gis/feeds.py
    index 4105ef7..c080352 100644
    a b  
    1 from django.contrib.syndication.feeds import Feed as BaseFeed, FeedDoesNotExist
     1from django.contrib.syndication.feeds import Feed as BaseFeed
    22from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
    33
    44class GeoFeedMixin(object):
  • django/contrib/gis/gdal/datasource.py

    diff --git a/django/contrib/gis/gdal/datasource.py b/django/contrib/gis/gdal/datasource.py
    index 7db5fd9..e5f3602 100644
    a b  
    3434              val = field.value
    3535"""
    3636# ctypes prerequisites.
    37 from ctypes import byref, c_void_p
     37from ctypes import byref
    3838
    3939# The GDAL C library, OGR exceptions, and the Layer object.
    4040from django.contrib.gis.gdal.base import GDALBase
  • django/contrib/gis/gdal/feature.py

    diff --git a/django/contrib/gis/gdal/feature.py b/django/contrib/gis/gdal/feature.py
    index b5c173a..47fd9e5 100644
    a b from django.contrib.gis.gdal.base import GDALBase  
    33from django.contrib.gis.gdal.error import OGRException, OGRIndexError
    44from django.contrib.gis.gdal.field import Field
    55from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
    6 from django.contrib.gis.gdal.srs import SpatialReference
    76
    87# ctypes function prototypes
    98from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api
  • django/contrib/gis/gdal/libgdal.py

    diff --git a/django/contrib/gis/gdal/libgdal.py b/django/contrib/gis/gdal/libgdal.py
    index 256ddb2..d904327 100644
    a b  
    1 import os, re, sys
     1import os
     2import re
    23from ctypes import c_char_p, CDLL
    34from ctypes.util import find_library
    45from django.contrib.gis.gdal.error import OGRException
  • django/contrib/gis/gdal/prototypes/ds.py

    diff --git a/django/contrib/gis/gdal/prototypes/ds.py b/django/contrib/gis/gdal/prototypes/ds.py
    index 44828ee..d8537bc 100644
    a b  
    66from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER
    77from django.contrib.gis.gdal.envelope import OGREnvelope
    88from django.contrib.gis.gdal.libgdal import lgdal
    9 from django.contrib.gis.gdal.prototypes.generation import \
    10     const_string_output, double_output, geom_output, int_output, \
    11     srs_output, void_output, voidptr_output
     9from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
     10    double_output, geom_output, int_output, srs_output, void_output, voidptr_output)
    1211
    1312c_int_p = POINTER(c_int) # shortcut type
    1413
  • django/contrib/gis/gdal/prototypes/generation.py

    diff --git a/django/contrib/gis/gdal/prototypes/generation.py b/django/contrib/gis/gdal/prototypes/generation.py
    index 1303532..45cffd6 100644
    a b  
    44"""
    55
    66from ctypes import c_char_p, c_double, c_int, c_void_p
    7 from django.contrib.gis.gdal.prototypes.errcheck import \
    8     check_arg_errcode, check_errcode, check_geom, check_geom_offset, \
    9     check_pointer, check_srs, check_str_arg, check_string, check_const_string
     7from django.contrib.gis.gdal.prototypes.errcheck import (
     8    check_arg_errcode, check_errcode, check_geom, check_geom_offset,
     9    check_pointer, check_srs, check_str_arg, check_string, check_const_string)
    1010
    1111class gdal_char_p(c_char_p):
    1212    pass
  • django/contrib/gis/gdal/prototypes/geom.py

    diff --git a/django/contrib/gis/gdal/prototypes/geom.py b/django/contrib/gis/gdal/prototypes/geom.py
    index e002590..7fa8391 100644
    a b  
    1 import re
    2 from datetime import date
    3 from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, c_void_p, POINTER
     1from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER
    42from django.contrib.gis.gdal.envelope import OGREnvelope
    53from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON
    64from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
    7 from django.contrib.gis.gdal.prototypes.generation import \
    8     const_string_output, double_output, geom_output, int_output, \
    9     srs_output, string_output, void_output
     5from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
     6    double_output, geom_output, int_output, srs_output, string_output, void_output)
    107
    118### Generation routines specific to this module ###
    129def env_func(f, argtypes):
  • django/contrib/gis/gdal/prototypes/srs.py

    diff --git a/django/contrib/gis/gdal/prototypes/srs.py b/django/contrib/gis/gdal/prototypes/srs.py
    index 411cec9..66cf84c 100644
    a b  
    11from ctypes import c_char_p, c_int, c_void_p, POINTER
    22from django.contrib.gis.gdal.libgdal import lgdal, std_call
    3 from django.contrib.gis.gdal.prototypes.generation import \
    4     const_string_output, double_output, int_output, \
    5     srs_output, string_output, void_output
     3from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
     4    double_output, int_output, srs_output, string_output, void_output)
    65
    76## Shortcut generation for routines with known parameters.
    87def srs_double(f):
  • django/contrib/gis/gdal/srs.py

    diff --git a/django/contrib/gis/gdal/srs.py b/django/contrib/gis/gdal/srs.py
    index 95e71f1..e211bac 100644
    a b  
    2626  >>> print srs.name
    2727  NAD83 / Texas South Central
    2828"""
    29 import re
    30 from ctypes import byref, c_char_p, c_int, c_void_p
     29from ctypes import byref, c_char_p, c_int
    3130
    3231# Getting the error checking routine and exceptions
    3332from django.contrib.gis.gdal.base import GDALBase
    34 from django.contrib.gis.gdal.error import OGRException, SRSException
     33from django.contrib.gis.gdal.error import SRSException
    3534from django.contrib.gis.gdal.prototypes import srs as capi
    3635
    3736#### Spatial Reference class. ####
  • django/contrib/gis/gdal/tests/test_driver.py

    diff --git a/django/contrib/gis/gdal/tests/test_driver.py b/django/contrib/gis/gdal/tests/test_driver.py
    index 1ff65ac..06ec93f 100644
    a b  
    1 import os, os.path, unittest
     1import unittest
    22from django.contrib.gis.gdal import Driver, OGRException
    33
    44valid_drivers = ('ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN',
  • django/contrib/gis/gdal/tests/test_geom.py

    diff --git a/django/contrib/gis/gdal/tests/test_geom.py b/django/contrib/gis/gdal/tests/test_geom.py
    index 7d4a1ff..5703a09 100644
    a b  
    1 from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, \
    2     OGRException, OGRIndexError, SpatialReference, CoordTransform, \
    3     GDAL_VERSION
     1from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType, OGRException,
     2    OGRIndexError, SpatialReference, CoordTransform, GDAL_VERSION)
    43from django.utils import unittest
    54from django.contrib.gis.geometry.test_data import TestDataMixin
    65
    class OGRGeomTest(unittest.TestCase, TestDataMixin):  
    446445
    447446    def test17_pickle(self):
    448447        "Testing pickle support."
    449         import cPickle
     448        try:
     449            import cPickle as pickle
     450        except ImportError:
     451            import pickle
    450452        g1 = OGRGeometry('LINESTRING(1 1 1,2 2 2,3 3 3)', 'WGS84')
    451         g2 = cPickle.loads(cPickle.dumps(g1))
     453        g2 = pickle.loads(pickle.dumps(g1))
    452454        self.assertEqual(g1, g2)
    453455        self.assertEqual(4326, g2.srs.srid)
    454456        self.assertEqual(g1.srs.wkt, g2.srs.wkt)
  • django/contrib/gis/geometry/backend/geos.py

    diff --git a/django/contrib/gis/geometry/backend/geos.py b/django/contrib/gis/geometry/backend/geos.py
    index a1ac096..cdc40ed 100644
    a b  
    1 from django.contrib.gis.geos import \
    2     GEOSGeometry as Geometry, \
    3     GEOSException as GeometryException
     1from django.contrib.gis.geos import (
     2    GEOSGeometry as Geometry, GEOSException as GeometryException)
  • django/contrib/gis/geos/base.py

    diff --git a/django/contrib/gis/geos/base.py b/django/contrib/gis/geos/base.py
    index 34c03c8..b3012dd 100644
    a b  
    11from ctypes import c_void_p
    22from types import NoneType
    3 from django.contrib.gis.geos.error import GEOSException, GEOSIndexError
     3from django.contrib.gis.geos.error import GEOSException
    44
    55# Trying to import GDAL libraries, if available.  Have to place in
    66# try/except since this package may be used outside GeoDjango.
  • django/contrib/gis/geos/collections.py

    diff --git a/django/contrib/gis/geos/collections.py b/django/contrib/gis/geos/collections.py
    index 515f80e..8b0edf5 100644
    a b  
    33 GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
    44"""
    55from ctypes import c_int, c_uint, byref
    6 from django.contrib.gis.geos.error import GEOSException, GEOSIndexError
     6from django.contrib.gis.geos.error import GEOSException
    77from django.contrib.gis.geos.geometry import GEOSGeometry
    8 from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR, GEOS_PREPARE
     8from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOS_PREPARE
    99from django.contrib.gis.geos.linestring import LineString, LinearRing
    1010from django.contrib.gis.geos.point import Point
    1111from django.contrib.gis.geos.polygon import Polygon
  • django/contrib/gis/geos/geometry.py

    diff --git a/django/contrib/gis/geos/geometry.py b/django/contrib/gis/geos/geometry.py
    index a9d1264..c56eeb3 100644
    a b  
    33 inherit from this object.
    44"""
    55# Python, ctypes and types dependencies.
    6 import re
    76import warnings
    8 from ctypes import addressof, byref, c_double, c_size_t
     7from ctypes import addressof, byref, c_double
    98
    109# super-class for mutable list behavior
    1110from django.contrib.gis.geos.mutable_list import ListMixin
  • django/contrib/gis/geos/libgeos.py

    diff --git a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py
    index 7e1dfa0..e73fcdb 100644
    a b  
    66 This module also houses GEOS Pointer utilities, including
    77 get_pointer_arr(), and GEOM_PTR.
    88"""
    9 import os, re, sys
     9import os
     10import re
     11import sys
    1012from ctypes import c_char_p, Structure, CDLL, CFUNCTYPE, POINTER
    1113from ctypes.util import find_library
    1214from django.contrib.gis.geos.error import GEOSException
  • django/contrib/gis/geos/polygon.py

    diff --git a/django/contrib/gis/geos/polygon.py b/django/contrib/gis/geos/polygon.py
    index 92b2e4c..77ce60c 100644
    a b  
    11from ctypes import c_uint, byref
    2 from django.contrib.gis.geos.error import GEOSIndexError
    32from django.contrib.gis.geos.geometry import GEOSGeometry
    43from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR
    54from django.contrib.gis.geos.linestring import LinearRing
  • django/contrib/gis/geos/prototypes/__init__.py

    diff --git a/django/contrib/gis/geos/prototypes/__init__.py b/django/contrib/gis/geos/prototypes/__init__.py
    index 23735f5..89b96c0 100644
    a b  
    55"""
    66
    77# Coordinate sequence routines.
    8 from django.contrib.gis.geos.prototypes.coordseq import create_cs, get_cs, \
    9     cs_clone, cs_getordinate, cs_setordinate, cs_getx, cs_gety, cs_getz, \
    10     cs_setx, cs_sety, cs_setz, cs_getsize, cs_getdims
     8from django.contrib.gis.geos.prototypes.coordseq import (create_cs, get_cs,
     9    cs_clone, cs_getordinate, cs_setordinate, cs_getx, cs_gety, cs_getz,
     10    cs_setx, cs_sety, cs_setz, cs_getsize, cs_getdims)
    1111
    1212# Geometry routines.
    13 from django.contrib.gis.geos.prototypes.geom import from_hex, from_wkb, from_wkt, \
    14     create_point, create_linestring, create_linearring, create_polygon, create_collection, \
    15     destroy_geom, get_extring, get_intring, get_nrings, get_geomn, geom_clone, \
    16     geos_normalize, geos_type, geos_typeid, geos_get_srid, geos_set_srid, \
    17     get_dims, get_num_coords, get_num_geoms, \
    18     to_hex, to_wkb, to_wkt
     13from django.contrib.gis.geos.prototypes.geom import (from_hex, from_wkb, from_wkt,
     14    create_point, create_linestring, create_linearring, create_polygon, create_collection,
     15    destroy_geom, get_extring, get_intring, get_nrings, get_geomn, geom_clone,
     16    geos_normalize, geos_type, geos_typeid, geos_get_srid, geos_set_srid,
     17    get_dims, get_num_coords, get_num_geoms,
     18    to_hex, to_wkb, to_wkt)
    1919
    2020# Miscellaneous routines.
    2121from django.contrib.gis.geos.prototypes.misc import *
    2222
    2323# Predicates
    24 from django.contrib.gis.geos.prototypes.predicates import geos_hasz, geos_isempty, \
    25     geos_isring, geos_issimple, geos_isvalid, geos_contains, geos_crosses, \
    26     geos_disjoint, geos_equals, geos_equalsexact, geos_intersects, \
    27     geos_intersects, geos_overlaps, geos_relatepattern, geos_touches, geos_within
     24from django.contrib.gis.geos.prototypes.predicates import (geos_hasz, geos_isempty,
     25    geos_isring, geos_issimple, geos_isvalid, geos_contains, geos_crosses,
     26    geos_disjoint, geos_equals, geos_equalsexact, geos_intersects,
     27    geos_intersects, geos_overlaps, geos_relatepattern, geos_touches, geos_within)
    2828
    2929# Topology routines
    3030from django.contrib.gis.geos.prototypes.topology import *
  • django/contrib/gis/geos/prototypes/geom.py

    diff --git a/django/contrib/gis/geos/prototypes/geom.py b/django/contrib/gis/geos/prototypes/geom.py
    index 03f9897..5a614fe 100644
    a b  
    1 from ctypes import c_char_p, c_int, c_size_t, c_ubyte, c_uint, POINTER
    2 from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, PREPGEOM_PTR, GEOS_PREPARE
    3 from django.contrib.gis.geos.prototypes.errcheck import \
    4     check_geom, check_minus_one, check_sized_string, check_string, check_zero
     1from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER
     2from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR
     3from django.contrib.gis.geos.prototypes.errcheck import (
     4    check_geom, check_minus_one, check_sized_string, check_string, check_zero)
    55from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
    66
    77# This is the return type used by binary output (WKB, HEX) routines.
  • django/contrib/gis/geos/prototypes/topology.py

    diff --git a/django/contrib/gis/geos/prototypes/topology.py b/django/contrib/gis/geos/prototypes/topology.py
    index 50817f9..cc5734b 100644
    a b __all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull',  
    77           'geos_linemerge', 'geos_pointonsurface', 'geos_preservesimplify',
    88           'geos_simplify', 'geos_symdifference', 'geos_union', 'geos_relate']
    99
    10 from ctypes import c_char_p, c_double, c_int
     10from ctypes import c_double, c_int
    1111from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOS_PREPARE
    1212from django.contrib.gis.geos.prototypes.errcheck import check_geom, check_string
    1313from django.contrib.gis.geos.prototypes.geom import geos_char_p
  • django/contrib/gis/geos/tests/test_geos.py

    diff --git a/django/contrib/gis/geos/tests/test_geos.py b/django/contrib/gis/geos/tests/test_geos.py
    index 4620a9f..f611dd4 100644
    a b  
    1 import ctypes, random, unittest, sys
     1import ctypes
     2import random
     3import unittest
    24from django.contrib.gis.geos import *
    35from django.contrib.gis.geos.base import gdal, numpy, GEOSBase
    46from django.contrib.gis.geos.libgeos import GEOS_PREPARE
  • django/contrib/gis/geos/tests/test_geos_mutation.py

    diff --git a/django/contrib/gis/geos/tests/test_geos_mutation.py b/django/contrib/gis/geos/tests/test_geos_mutation.py
    index c8f7e65..0c69b2b 100644
    a b  
    22# Modified from original contribution by Aryeh Leib Taurog, which was
    33# released under the New BSD license.
    44
    5 import copy
    65from django.contrib.gis.geos import *
    76from django.contrib.gis.geos.error import GEOSIndexError
    87from django.utils import unittest
  • django/contrib/gis/geos/tests/test_io.py

    diff --git a/django/contrib/gis/geos/tests/test_io.py b/django/contrib/gis/geos/tests/test_io.py
    index cc0f1ed..50c3668 100644
    a b  
    1 import binascii, ctypes, unittest
     1import binascii
     2import unittest
    23from django.contrib.gis.geos import GEOSGeometry, WKTReader, WKTWriter, WKBReader, WKBWriter, geos_version_info
    34
    45class GEOSIOTest(unittest.TestCase):
  • django/contrib/gis/management/commands/inspectdb.py

    diff --git a/django/contrib/gis/management/commands/inspectdb.py b/django/contrib/gis/management/commands/inspectdb.py
    index 937bb8e..bbf40e1 100644
    a b  
    1 from optparse import make_option
    2 
    3 from django.core.management.base import CommandError
    41from django.core.management.commands.inspectdb import Command as InspectDBCommand
    52
    63class Command(InspectDBCommand):
  • django/contrib/gis/management/commands/ogrinspect.py

    diff --git a/django/contrib/gis/management/commands/ogrinspect.py b/django/contrib/gis/management/commands/ogrinspect.py
    index a495787..13f1c0a 100644
    a b  
    1 import os, sys
     1import os
    22from optparse import make_option
    33from django.contrib.gis import gdal
    44from django.contrib.gis.management.base import ArgsCommand, CommandError
  • django/contrib/gis/maps/google/gmap.py

    diff --git a/django/contrib/gis/maps/google/gmap.py b/django/contrib/gis/maps/google/gmap.py
    index cca5dc9..0c0703d 100644
    a b  
    11from django.conf import settings
    2 from django.contrib.gis import geos
    32from django.template.loader import render_to_string
    43from django.utils.safestring import mark_safe
    54
    6 class GoogleMapException(Exception): pass
    7 from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker, GIcon
     5class GoogleMapException(Exception):
     6    pass
     7
     8from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker
    89
    910# The default Google Maps URL (for the API javascript)
    1011# TODO: Internationalize for Japan, UK, etc.
  • django/contrib/gis/maps/google/zoom.py

    diff --git a/django/contrib/gis/maps/google/zoom.py b/django/contrib/gis/maps/google/zoom.py
    index abc3fbf..7e7219f 100644
    a b  
    11from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point
    22from django.contrib.gis.maps.google.gmap import GoogleMapException
    3 from math import pi, sin, cos, log, exp, atan
     3from math import pi, sin, log, exp, atan
    44
    55# Constants used for degree to radian conversion, and vice-versa.
    66DTOR = pi / 180.
  • django/contrib/gis/shortcuts.py

    diff --git a/django/contrib/gis/shortcuts.py b/django/contrib/gis/shortcuts.py
    index a6fb892..1fba780 100644
    a b  
    1 import cStringIO, zipfile
     1try:
     2    from cStringIO import StringIO
     3except ImportError:
     4    from StringIO import StringIO
     5import zipfile
    26from django.conf import settings
    37from django.http import HttpResponse
    48from django.template import loader
    59
    610def compress_kml(kml):
    711    "Returns compressed KMZ from the given KML string."
    8     kmz = cStringIO.StringIO()
     12    kmz = StringIO()
    913    zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED)
    1014    zf.writestr('doc.kml', kml.encode(settings.DEFAULT_CHARSET))
    1115    zf.close()
  • django/contrib/gis/tests/distapp/tests.py

    diff --git a/django/contrib/gis/tests/distapp/tests.py b/django/contrib/gis/tests/distapp/tests.py
    index 4f81a91..4961a02 100644
    a b  
    1 import os
    2 from decimal import Decimal
    3 
    41from django.db import connection
    52from django.db.models import Q
    6 from django.contrib.gis.geos import GEOSGeometry, Point, LineString
     3from django.contrib.gis.geos import GEOSGeometry, LineString
    74from django.contrib.gis.measure import D # alias for Distance
    85from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_spatialite
    96from django.test import TestCase
    107
    11 from models import AustraliaCity, Interstate, SouthTexasInterstate, \
    12     SouthTexasCity, SouthTexasCityFt, CensusZipcode, SouthTexasZipcode
     8from models import (AustraliaCity, Interstate, SouthTexasInterstate,
     9    SouthTexasCity, SouthTexasCityFt, CensusZipcode, SouthTexasZipcode)
    1310
    1411class DistanceTest(TestCase):
    1512
  • django/contrib/gis/tests/geo3d/tests.py

    diff --git a/django/contrib/gis/tests/geo3d/tests.py b/django/contrib/gis/tests/geo3d/tests.py
    index 324002e..be05964 100644
    a b from django.contrib.gis.db.models import Union, Extent3D  
    55from django.contrib.gis.geos import GEOSGeometry, Point, Polygon
    66from django.contrib.gis.utils import LayerMapping, LayerMapError
    77
    8 from models import City3D, Interstate2D, Interstate3D, \
    9     InterstateProj2D, InterstateProj3D, \
    10     Point2D, Point3D, MultiPoint3D, Polygon2D, Polygon3D
     8from models import (City3D, Interstate2D, Interstate3D,
     9    InterstateProj2D, InterstateProj3D,
     10    Point2D, Point3D, MultiPoint3D, Polygon2D, Polygon3D)
    1111
    1212data_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'data'))
    1313city_file = os.path.join(data_path, 'cities', 'cities.shp')
  • django/contrib/gis/tests/geoapp/feeds.py

    diff --git a/django/contrib/gis/tests/geoapp/feeds.py b/django/contrib/gis/tests/geoapp/feeds.py
    index 942b140..f2e8f73 100644
    a b  
    11from django.contrib.gis import feeds
    2 from django.contrib.gis.tests.utils import mysql
    3 from models import City, Country
     2from models import City
    43
    54class TestGeoRSS1(feeds.Feed):
    65    link = '/city/'
  • django/contrib/gis/tests/geoapp/test_regress.py

    diff --git a/django/contrib/gis/tests/geoapp/test_regress.py b/django/contrib/gis/tests/geoapp/test_regress.py
    index 0295526..d222194 100644
    a b  
    1 import os, unittest
    2 from django.contrib.gis.tests.utils import no_mysql, no_oracle, no_postgis, no_spatialite
     1import os
     2import unittest
     3from django.contrib.gis.tests.utils import no_mysql, no_spatialite
    34from django.contrib.gis.shortcuts import render_to_kmz
    45from models import City
    56
  • django/contrib/gis/tests/geoapp/test_sitemaps.py

    diff --git a/django/contrib/gis/tests/geoapp/test_sitemaps.py b/django/contrib/gis/tests/geoapp/test_sitemaps.py
    index 16e0433..a6f0c9b 100644
    a b  
    1 import cStringIO
     1try:
     2    from cStringIO import StringIO
     3except ImportError:
     4    from StringIO import StringIO
    25from xml.dom import minidom
    36import zipfile
    47from django.conf import settings
    class GeoSitemapTest(TestCase):  
    6063                    kml_doc = minidom.parseString(self.client.get(kml_url).content)
    6164                elif kml_type == 'kmz':
    6265                    # Have to decompress KMZ before parsing.
    63                     buf = cStringIO.StringIO(self.client.get(kml_url).content)
     66                    buf = StringIO(self.client.get(kml_url).content)
    6467                    zf = zipfile.ZipFile(buf)
    6568                    self.assertEqual(1, len(zf.filelist))
    6669                    self.assertEqual('doc.kml', zf.filelist[0].filename)
  • django/contrib/gis/tests/geoapp/tests.py

    diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py
    index 296f128..2960aee 100644
    a b  
    11import re
    22from django.db import connection
    33from django.contrib.gis import gdal
    4 from django.contrib.gis.geos import fromstr, GEOSGeometry, \
    5     Point, LineString, LinearRing, Polygon, GeometryCollection
    6 from django.contrib.gis.measure import Distance
    7 from django.contrib.gis.tests.utils import \
    8     no_mysql, no_oracle, no_spatialite, \
    9     mysql, oracle, postgis, spatialite
     4from django.contrib.gis.geos import (fromstr, GEOSGeometry,
     5    Point, LineString, LinearRing, Polygon, GeometryCollection)
     6from django.contrib.gis.tests.utils import (
     7    no_mysql, no_oracle, no_spatialite,
     8    mysql, oracle, postgis, spatialite)
    109from django.test import TestCase
    1110
    1211from models import Country, City, PennsylvaniaCity, State, Track
  • django/contrib/gis/tests/geogapp/tests.py

    diff --git a/django/contrib/gis/tests/geogapp/tests.py b/django/contrib/gis/tests/geogapp/tests.py
    index cb69ce9..b3a86cd 100644
    a b class GeographyTest(TestCase):  
    7979
    8080    def test06_geography_area(self):
    8181        "Testing that Area calculations work on geography columns."
    82         from django.contrib.gis.measure import A
    8382        # SELECT ST_Area(poly) FROM geogapp_zipcode WHERE code='77002';
    8483        ref_area = 5439084.70637573
    8584        tol = 5
  • django/contrib/gis/tests/layermap/tests.py

    diff --git a/django/contrib/gis/tests/layermap/tests.py b/django/contrib/gis/tests/layermap/tests.py
    index 2214840..0480e43 100644
    a b from decimal import Decimal  
    44
    55from django.utils.unittest import TestCase
    66
    7 from django.contrib.gis.gdal import DataSource, OGRException
     7from django.contrib.gis.gdal import DataSource
    88from django.contrib.gis.tests.utils import mysql
    99from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, InvalidDecimal, MissingForeignKey
    1010
    11 from models import \
    12     City, County, CountyFeat, Interstate, ICity1, ICity2, Invalid, State, \
    13     city_mapping, co_mapping, cofeat_mapping, inter_mapping
     11from models import (
     12    City, County, CountyFeat, Interstate, ICity1, ICity2, Invalid, State,
     13    city_mapping, co_mapping, cofeat_mapping, inter_mapping)
    1414
    1515shp_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.pardir, 'data'))
    1616city_shp = os.path.join(shp_path, 'cities', 'cities.shp')
  • django/contrib/gis/tests/test_geoip.py

    diff --git a/django/contrib/gis/tests/test_geoip.py b/django/contrib/gis/tests/test_geoip.py
    index a9ab6a6..c092437 100644
    a b  
    1 import os, unittest
     1import os
     2import unittest
    23from django.db import settings
    34from django.contrib.gis.geos import GEOSGeometry
    45from django.contrib.gis.utils import GeoIP, GeoIPException
  • django/contrib/gis/tests/test_spatialrefsys.py

    diff --git a/django/contrib/gis/tests/test_spatialrefsys.py b/django/contrib/gis/tests/test_spatialrefsys.py
    index d9c8c38..608f645 100644
    a b  
    11from django.db import connection
    22from django.contrib.gis.gdal import GDAL_VERSION
    3 from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite
     3from django.contrib.gis.tests.utils import no_mysql, oracle, postgis, spatialite
    44from django.utils import unittest
    55
    66
  • django/contrib/gis/utils/geoip.py

    diff --git a/django/contrib/gis/utils/geoip.py b/django/contrib/gis/utils/geoip.py
    index eedaef9..29b949f 100644
    a b  
    3838 >>> g.geos('24.124.1.80').wkt
    3939 'POINT (-95.2087020874023438 39.0392990112304688)'
    4040"""
    41 import os, re
     41import os
     42import re
    4243from ctypes import c_char_p, c_float, c_int, Structure, CDLL, POINTER
    4344from ctypes.util import find_library
    4445from django.conf import settings
  • django/contrib/gis/utils/layermapping.py

    diff --git a/django/contrib/gis/utils/layermapping.py b/django/contrib/gis/utils/layermapping.py
    index a970b07..d368112 100644
    a b  
    77   http://geodjango.org/docs/layermapping.html
    88"""
    99import sys
    10 from datetime import date, datetime
    1110from decimal import Decimal
    1211from django.core.exceptions import ObjectDoesNotExist
    1312from django.db import connections, DEFAULT_DB_ALIAS
    1413from django.contrib.gis.db.models import GeometryField
    15 from django.contrib.gis.gdal import CoordTransform, DataSource, \
    16     OGRException, OGRGeometry, OGRGeomType, SpatialReference
    17 from django.contrib.gis.gdal.field import \
    18     OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString, OFTTime
     14from django.contrib.gis.gdal import (CoordTransform, DataSource,
     15    OGRException, OGRGeometry, OGRGeomType, SpatialReference)
     16from django.contrib.gis.gdal.field import (
     17    OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString, OFTTime)
    1918from django.db import models, transaction
    2019from django.contrib.localflavor.us.models import USStateField
    2120
  • django/contrib/gis/utils/ogrinspect.py

    diff --git a/django/contrib/gis/utils/ogrinspect.py b/django/contrib/gis/utils/ogrinspect.py
    index 145bd22..fe4443c 100644
    a b Author: Travis Pinney, Dane Springmeyer, & Justin Bronn  
    88from itertools import izip
    99# Requires GDAL to use.
    1010from django.contrib.gis.gdal import DataSource
    11 from django.contrib.gis.gdal.field import OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString, OFTTime
     11from django.contrib.gis.gdal.field import OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString
    1212
    1313def mapping(data_source, geom_name='geom', layer_key=0, multi_geom=False):
    1414    """
  • django/contrib/localflavor/ar/forms.py

    diff --git a/django/contrib/localflavor/ar/forms.py b/django/contrib/localflavor/ar/forms.py
    index 57b5f8b..36b7530 100644
    a b AR-specific Form helpers.  
    66from django.forms import ValidationError
    77from django.core.validators import EMPTY_VALUES
    88from django.forms.fields import RegexField, CharField, Select
    9 from django.utils.encoding import smart_unicode
    109from django.utils.translation import ugettext_lazy as _
    1110
    1211class ARProvinceSelect(Select):
  • django/contrib/localflavor/au/models.py

    diff --git a/django/contrib/localflavor/au/models.py b/django/contrib/localflavor/au/models.py
    index e2b897e..ce4f120 100644
    a b  
    1 from django.conf import settings
    21from django.utils.translation import ugettext_lazy as _
    32from django.db.models.fields import CharField
    43
  • django/contrib/localflavor/be/forms.py

    diff --git a/django/contrib/localflavor/be/forms.py b/django/contrib/localflavor/be/forms.py
    index 6715e87..4e86d7e 100644
    a b  
    11"""
    22Belgium-specific Form helpers
    33"""
    4 import re
    5 
    6 from django.core.validators import EMPTY_VALUES
    7 from django.forms import ValidationError
    84from django.forms.fields import RegexField, Select
    95from django.utils.translation import ugettext_lazy as _
    106
  • django/contrib/localflavor/in_/forms.py

    diff --git a/django/contrib/localflavor/in_/forms.py b/django/contrib/localflavor/in_/forms.py
    index c94c7e7..c09d257 100644
    a b from django.forms import ValidationError  
    77from django.forms.fields import Field, RegexField, Select
    88from django.utils.encoding import smart_unicode
    99from django.utils.translation import gettext
    10 import re
    1110
    1211
    1312class INZipCodeField(RegexField):
  • django/contrib/localflavor/jp/forms.py

    diff --git a/django/contrib/localflavor/jp/forms.py b/django/contrib/localflavor/jp/forms.py
    index 248a938..11dc6e8 100644
    a b  
    22JP-specific Form helpers
    33"""
    44
    5 from django.forms import ValidationError
    65from django.utils.translation import ugettext_lazy as _
    76from django.forms.fields import RegexField, Select
    87
  • django/contrib/localflavor/kw/forms.py

    diff --git a/django/contrib/localflavor/kw/forms.py b/django/contrib/localflavor/kw/forms.py
    index 9429625..e671408 100644
    a b from datetime import date  
    66
    77from django.core.validators import EMPTY_VALUES
    88from django.forms import ValidationError
    9 from django.forms.fields import Field, RegexField
     9from django.forms.fields import Field
    1010from django.utils.translation import gettext as _
    1111
    1212id_re = re.compile(r'^(?P<initial>\d{1})(?P<yy>\d\d)(?P<mm>\d\d)(?P<dd>\d\d)(?P<mid>\d{4})(?P<checksum>\d{1})')
  • django/contrib/localflavor/no/forms.py

    diff --git a/django/contrib/localflavor/no/forms.py b/django/contrib/localflavor/no/forms.py
    index abe3b80..930cc17 100644
    a b  
    22Norwegian-specific Form helpers
    33"""
    44
    5 import re, datetime
     5import re
     6import datetime
    67from django.core.validators import EMPTY_VALUES
    78from django.forms import ValidationError
    89from django.forms.fields import Field, RegexField, Select
  • django/contrib/localflavor/pt/forms.py

    diff --git a/django/contrib/localflavor/pt/forms.py b/django/contrib/localflavor/pt/forms.py
    index 2a563cf..3de7376 100644
    a b  
    11"""
    22PT-specific Form helpers
    33"""
     4import re
    45
    56from django.core.validators import EMPTY_VALUES
    67from django.forms import ValidationError
    7 from django.forms.fields import Field, RegexField, Select
     8from django.forms.fields import Field, RegexField
    89from django.utils.encoding import smart_unicode
    910from django.utils.translation import ugettext_lazy as _
    10 import re
    1111
    1212phone_digits_re = re.compile(r'^(\d{9}|(00|\+)\d*)$')
    1313
  • django/contrib/localflavor/ro/forms.py

    diff --git a/django/contrib/localflavor/ro/forms.py b/django/contrib/localflavor/ro/forms.py
    index 3bfb0fa..1121f8e 100644
    a b  
    22"""
    33Romanian specific form helpers.
    44"""
    5 
    6 import re
    7 
    85from django.core.validators import EMPTY_VALUES
    96from django.forms import ValidationError, Field, RegexField, Select
    107from django.utils.translation import ugettext_lazy as _
  • django/contrib/localflavor/ru/forms.py

    diff --git a/django/contrib/localflavor/ru/forms.py b/django/contrib/localflavor/ru/forms.py
    index d091eab..a8662b5 100644
    a b Russian-specific forms helpers  
    33"""
    44import re
    55
    6 from django.core.validators import EMPTY_VALUES
    7 from django.forms import ValidationError
    8 from django.forms.fields import CharField, Select, RegexField
     6from django.forms.fields import RegexField, Select
    97from django.utils.translation import ugettext_lazy as _
    108
    119phone_digits_re = re.compile(r'^(?:[78]-?)?(\d{3})[-\.]?(\d{3})[-\.]?(\d{4})$')
  • django/contrib/localflavor/se/utils.py

    diff --git a/django/contrib/localflavor/se/utils.py b/django/contrib/localflavor/se/utils.py
    index 50d8ac1..5f65d8f 100644
    a b  
    1 import re
    21import datetime
    32
    43def id_number_checksum(gd):
  • django/contrib/localflavor/us/models.py

    diff --git a/django/contrib/localflavor/us/models.py b/django/contrib/localflavor/us/models.py
    index d5f7976..7cec205 100644
    a b  
    1 from django.conf import settings
    21from django.utils.translation import ugettext_lazy as _
    32from django.db.models.fields import CharField
    43from django.contrib.localflavor.us.us_states import STATE_CHOICES
  • django/contrib/localflavor/uy/forms.py

    diff --git a/django/contrib/localflavor/uy/forms.py b/django/contrib/localflavor/uy/forms.py
    index 3f70cf3..2d90e52 100644
    a b  
    22"""
    33UY-specific form helpers.
    44"""
    5 import re
    6 
    75from django.core.validators import EMPTY_VALUES
    86from django.forms.fields import Select, RegexField
    97from django.forms import ValidationError
  • django/contrib/messages/api.py

    diff --git a/django/contrib/messages/api.py b/django/contrib/messages/api.py
    index 9880d7f..8e08655 100644
    a b  
    11from django.contrib.messages import constants
    22from django.contrib.messages.storage import default_storage
    3 from django.utils.functional import lazy, memoize
    43
    54__all__ = (
    65    'add_message', 'get_messages',
  • django/contrib/messages/storage/cookie.py

    diff --git a/django/contrib/messages/storage/cookie.py b/django/contrib/messages/storage/cookie.py
    index 45a20d0..c45dff4 100644
    a b  
    11from django.conf import settings
    2 from django.contrib.messages import constants
    32from django.contrib.messages.storage.base import BaseStorage, Message
    43from django.http import SimpleCookie
    54from django.utils import simplejson as json
  • django/contrib/messages/tests/base.py

    diff --git a/django/contrib/messages/tests/base.py b/django/contrib/messages/tests/base.py
    index c6886a8..416d16c 100644
    a b  
    1 import warnings
    2 
    31from django import http
    42from django.test import TestCase
    53from django.conf import settings
  • django/contrib/messages/tests/cookie.py

    diff --git a/django/contrib/messages/tests/cookie.py b/django/contrib/messages/tests/cookie.py
    index 95e1f99..f22ed39 100644
    a b  
    11from django.contrib.messages import constants
    22from django.contrib.messages.tests.base import BaseTest
    3 from django.contrib.messages.storage.cookie import CookieStorage, \
    4                                             MessageEncoder, MessageDecoder
     3from django.contrib.messages.storage.cookie import (CookieStorage,
     4    MessageEncoder, MessageDecoder)
    55from django.contrib.messages.storage.base import Message
    66from django.utils import simplejson as json
    77from django.conf import settings
  • django/contrib/messages/tests/fallback.py

    diff --git a/django/contrib/messages/tests/fallback.py b/django/contrib/messages/tests/fallback.py
    index 9e4f657..0aa6500 100644
    a b  
    11from django.contrib.messages import constants
    2 from django.contrib.messages.storage.fallback import FallbackStorage, \
    3     CookieStorage
     2from django.contrib.messages.storage.fallback import (FallbackStorage,
     3    CookieStorage)
    44from django.contrib.messages.tests.base import BaseTest
    5 from django.contrib.messages.tests.cookie import set_cookie_data, \
    6     stored_cookie_messages_count
    7 from django.contrib.messages.tests.session import set_session_data, \
    8     stored_session_messages_count
     5from django.contrib.messages.tests.cookie import (set_cookie_data,
     6    stored_cookie_messages_count)
     7from django.contrib.messages.tests.session import (set_session_data,
     8    stored_session_messages_count)
    99
    1010
    1111class FallbackTest(BaseTest):
  • django/contrib/messages/tests/urls.py

    diff --git a/django/contrib/messages/tests/urls.py b/django/contrib/messages/tests/urls.py
    index 5191f34..263b0a8 100644
    a b from django.conf.urls.defaults import *  
    22from django.contrib import messages
    33from django.core.urlresolvers import reverse
    44from django.http import HttpResponseRedirect, HttpResponse
    5 from django.shortcuts import render_to_response, redirect
    65from django.template import RequestContext, Template
    76from django.template.response import TemplateResponse
    87from django.views.decorators.cache import never_cache
  • django/contrib/sessions/backends/base.py

    diff --git a/django/contrib/sessions/backends/base.py b/django/contrib/sessions/backends/base.py
    index 1c7c188..050ed7b 100644
    a b import base64  
    22import hashlib
    33import os
    44import random
    5 import sys
    65import time
    76from datetime import datetime, timedelta
    87try:
  • django/contrib/sessions/backends/db.py

    diff --git a/django/contrib/sessions/backends/db.py b/django/contrib/sessions/backends/db.py
    index 9a53790..220046f 100644
    a b  
    11import datetime
    2 from django.conf import settings
    32from django.contrib.sessions.backends.base import SessionBase, CreateError
    43from django.core.exceptions import SuspiciousOperation
    54from django.db import IntegrityError, transaction, router
  • django/contrib/sessions/models.py

    diff --git a/django/contrib/sessions/models.py b/django/contrib/sessions/models.py
    index 1d82a99..0179c35 100644
    a b  
    1 import base64
    2 import cPickle as pickle
    3 
    41from django.db import models
    52from django.utils.translation import ugettext_lazy as _
    63
  • django/contrib/sitemaps/__init__.py

    diff --git a/django/contrib/sitemaps/__init__.py b/django/contrib/sitemaps/__init__.py
    index 6b8d5a0..a225b77 100644
    a b  
    1 from django.contrib.sites.models import Site, get_current_site
     1from django.contrib.sites.models import Site
    22from django.core import urlresolvers, paginator
    33from django.core.exceptions import ImproperlyConfigured
    44import urllib
  • django/core/cache/backends/base.py

    diff --git a/django/core/cache/backends/base.py b/django/core/cache/backends/base.py
    index 513adb4..f7573b2 100644
    a b  
    22
    33import warnings
    44
    5 from django.conf import settings
    65from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
    76from django.utils.encoding import smart_str
    87from django.utils.importlib import import_module
  • django/core/cache/backends/db.py

    diff --git a/django/core/cache/backends/db.py b/django/core/cache/backends/db.py
    index 495812a..b4743af 100644
    a b  
    22
    33from django.core.cache.backends.base import BaseCache
    44from django.db import connections, router, transaction, DatabaseError
    5 import base64, time
     5import base64
    66from datetime import datetime
    77try:
    88    import cPickle as pickle
    99except ImportError:
    1010    import pickle
     11import time
    1112
    1213class Options(object):
    1314    """A class that will quack like a Django model _meta class.
  • django/core/cache/backends/memcached.py

    diff --git a/django/core/cache/backends/memcached.py b/django/core/cache/backends/memcached.py
    index e452498..1e1d97e 100644
    a b import time  
    44from threading import local
    55
    66from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError
    7 from django.utils import importlib
    87
    98class BaseMemcachedCache(BaseCache):
    109    def __init__(self, server, params, library, value_not_found_exception):
  • django/core/handlers/modpython.py

    diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py
    index 5affea4..eba9dd3 100644
    a b  
    11import os
    2 from pprint import pformat
    32import sys
    43from warnings import warn
    54
    from django.core import signals  
    87from django.core.handlers.base import BaseHandler
    98from django.core.urlresolvers import set_script_prefix
    109from django.utils import datastructures
    11 from django.utils.encoding import force_unicode, smart_str, iri_to_uri
     10from django.utils.encoding import force_unicode, iri_to_uri
    1211from django.utils.log import getLogger
    1312
    1413logger = getLogger('django.request')
  • django/core/handlers/profiler-hotshot.py

    diff --git a/django/core/handlers/profiler-hotshot.py b/django/core/handlers/profiler-hotshot.py
    index 6cf94b0..0522de6 100644
    a b  
    1 import hotshot, time, os
     1import hotshot
     2import os
     3import time
     4
    25from django.core.handlers.modpython import ModPythonHandler
    36
    47PROFILE_DATA_DIR = "/var/log/cmsprofile"
  • django/core/handlers/wsgi.py

    diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py
    index 2acb3b1..d288581 100644
    a b  
    1 from pprint import pformat
    21import sys
    32from threading import Lock
    43try:
  • django/core/mail/__init__.py

    diff --git a/django/core/mail/__init__.py b/django/core/mail/__init__.py
    index 2c71b11..f363fc5 100644
    a b from django.utils.importlib import import_module  
    1111# django/core/mail.py before the introduction of email
    1212# backends and the subsequent reorganization (See #10355)
    1313from django.core.mail.utils import CachedDnsName, DNS_NAME
    14 from django.core.mail.message import \
    15     EmailMessage, EmailMultiAlternatives, \
    16     SafeMIMEText, SafeMIMEMultipart, \
    17     DEFAULT_ATTACHMENT_MIME_TYPE, make_msgid, \
    18     BadHeaderError, forbid_multi_line_headers
     14from django.core.mail.message import (
     15    EmailMessage, EmailMultiAlternatives,
     16    SafeMIMEText, SafeMIMEMultipart,
     17    DEFAULT_ATTACHMENT_MIME_TYPE, make_msgid,
     18    BadHeaderError, forbid_multi_line_headers)
    1919from django.core.mail.backends.smtp import EmailBackend as _SMTPConnection
    2020
    2121def get_connection(backend=None, fail_silently=False, **kwds):
  • django/core/management/commands/reset.py

    diff --git a/django/core/management/commands/reset.py b/django/core/management/commands/reset.py
    index 8aa7e88..9539212 100644
    a b  
    11from optparse import make_option
    22
    3 from django.conf import settings
    43from django.core.management.base import AppCommand, CommandError
    54from django.core.management.color import no_style
    65from django.core.management.sql import sql_reset
  • django/core/serializers/base.py

    diff --git a/django/core/serializers/base.py b/django/core/serializers/base.py
    index 6afaf21..ffc869c 100644
    a b Module for abstract serializer/unserializer base classes.  
    55from StringIO import StringIO
    66
    77from django.db import models
    8 from django.utils.encoding import smart_str, smart_unicode
    9 from django.utils import datetime_safe
     8from django.utils.encoding import smart_unicode
    109
    1110class SerializerDoesNotExist(KeyError):
    1211    """The requested serializer was not found."""
  • django/core/servers/fastcgi.py

    diff --git a/django/core/servers/fastcgi.py b/django/core/servers/fastcgi.py
    index 7e724c2..9f80d2b 100644
    a b Run with the extra option "help" for a list of additional options you can  
    1212pass to this server.
    1313"""
    1414
     15import os
     16import sys
    1517from django.utils import importlib
    16 import sys, os
    1718
    1819__version__ = "0.1"
    1920__all__ = ["runfastcgi"]
  • django/db/__init__.py

    diff --git a/django/db/__init__.py b/django/db/__init__.py
    index 2148cf0..8395468 100644
    a b  
    11from django.conf import settings
    22from django.core import signals
    33from django.core.exceptions import ImproperlyConfigured
    4 from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, \
    5                             DatabaseError, IntegrityError
     4from django.db.utils import (ConnectionHandler, ConnectionRouter,
     5    load_backend, DEFAULT_DB_ALIAS, DatabaseError, IntegrityError)
    66
    77__all__ = ('backend', 'connection', 'connections', 'router', 'DatabaseError',
    88    'IntegrityError', 'DEFAULT_DB_ALIAS')
  • django/db/backends/__init__.py

    diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
    index b64fb01..1c3bc7e 100644
    a b  
    1 import decimal
    21try:
    32    import thread
    43except ImportError:
  • django/db/backends/dummy/base.py

    diff --git a/django/db/backends/dummy/base.py b/django/db/backends/dummy/base.py
    index 7de48c8..a2aef52 100644
    a b Each of these API functions, except connection.close(), raises  
    77ImproperlyConfigured.
    88"""
    99
     10import decimal
     11
    1012from django.core.exceptions import ImproperlyConfigured
    1113from django.db.backends import *
    1214from django.db.backends.creation import BaseDatabaseCreation
  • django/db/backends/mysql/base.py

    diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
    index 6d02aa7..3338690 100644
    a b MySQL database backend for Django.  
    44Requires MySQLdb: http://sourceforge.net/projects/mysql-python
    55"""
    66
     7import decimal
    78import re
    89import sys
    910
  • django/db/backends/oracle/base.py

    diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py
    index 42de0dd..930b1bb 100644
    a b Requires cx_Oracle: http://cx-oracle.sourceforge.net/  
    66
    77
    88import datetime
    9 from decimal import Decimal
     9import decimal
    1010import sys
    1111
    1212
    def _rowfactory(row, cursor):  
    730730                    # This will normally be an integer from a sequence,
    731731                    # but it could be a decimal value.
    732732                    if '.' in value:
    733                         value = Decimal(value)
     733                        value = decimal.Decimal(value)
    734734                    else:
    735735                        value = int(value)
    736736                else:
    def _rowfactory(row, cursor):  
    743743                if scale == 0:
    744744                    value = int(value)
    745745                else:
    746                     value = Decimal(value)
     746                    value = decimal.Decimal(value)
    747747            elif '.' in value:
    748748                # No type information. This normally comes from a
    749749                # mathematical expression in the SELECT list. Guess int
    750750                # or Decimal based on whether it has a decimal point.
    751                 value = Decimal(value)
     751                value = decimal.Decimal(value)
    752752            else:
    753753                value = int(value)
    754754        elif desc[1] in (Database.STRING, Database.FIXED_CHAR,
  • django/db/backends/oracle/creation.py

    diff --git a/django/db/backends/oracle/creation.py b/django/db/backends/oracle/creation.py
    index 0403e0a..893b5dd 100644
    a b  
    1 import sys, time
     1import sys
     2import time
    23from django.db.backends.creation import BaseDatabaseCreation
    34
    45TEST_DATABASE_PREFIX = 'test_'
  • django/db/backends/postgresql_psycopg2/base.py

    diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py
    index 67e2877..122ec78 100644
    a b PostgreSQL database backend for Django.  
    33
    44Requires psycopg 2: http://initd.org/projects/psycopg2
    55"""
    6 
    76import sys
    87
    98from django.db import utils
  • django/db/backends/postgresql_psycopg2/operations.py

    diff --git a/django/db/backends/postgresql_psycopg2/operations.py b/django/db/backends/postgresql_psycopg2/operations.py
    index 3315913..3376ca8 100644
    a b  
    1 import re
    2 
    31from django.db.backends import BaseDatabaseOperations
    42
    53
  • django/db/backends/sqlite3/base.py

    diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py
    index 5b4a1c2..79c5ede 100644
    a b Works with either the pysqlite2 module or the sqlite3 module in the  
    55standard library.
    66"""
    77
     8import datetime
     9import decimal
    810import re
    911import sys
    10 import datetime
    1112
    1213from django.db import utils
    1314from django.db.backends import *
  • django/db/models/base.py

    diff --git a/django/db/models/base.py b/django/db/models/base.py
    index 31310ea..14f6ee7 100644
    a b  
    11import copy
    22import sys
    3 import types
    43from functools import update_wrapper
    54from itertools import izip
    65
    import django.db.models.manager # Imported to register signal handler.  
    87from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned, FieldError, ValidationError, NON_FIELD_ERRORS
    98from django.core import validators
    109from django.db.models.fields import AutoField, FieldDoesNotExist
    11 from django.db.models.fields.related import (OneToOneRel, ManyToOneRel,
    12     OneToOneField, add_lazy_relation)
     10from django.db.models.fields.related import ManyToOneRel, OneToOneField, add_lazy_relation
    1311from django.db.models.query import Q
    1412from django.db.models.query_utils import DeferredAttribute
    1513from django.db.models.deletion import Collector
  • django/db/models/deletion.py

    diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py
    index 310e3af..e165346 100644
    a b from operator import attrgetter  
    33
    44from django.db import connections, transaction, IntegrityError
    55from django.db.models import signals, sql
    6 from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE
    76from django.utils.datastructures import SortedDict
    87
    98
  • django/db/models/fields/files.py

    diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py
    index 50dc236..d0dbf23 100644
    a b  
    11import datetime
    22import os
    33
    4 from django.conf import settings
     4from django import forms
    55from django.db.models.fields import Field
    6 from django.core.files.base import File, ContentFile
     6from django.core.files.base import File
    77from django.core.files.storage import default_storage
    8 from django.core.files.images import ImageFile, get_image_dimensions
    9 from django.core.files.uploadedfile import UploadedFile
    10 from django.utils.functional import curry
     8from django.core.files.images import ImageFile
    119from django.db.models import signals
    1210from django.utils.encoding import force_unicode, smart_str
    13 from django.utils.translation import ugettext_lazy, ugettext as _
    14 from django import forms
    15 from django.db.models.loading import cache
     11from django.utils.translation import ugettext_lazy as _
    1612
    1713class FieldFile(File):
    1814    def __init__(self, instance, field, name):
    class FileField(Field):  
    215211    # The descriptor to use for accessing the attribute off of the class.
    216212    descriptor_class = FileDescriptor
    217213
    218     description = ugettext_lazy("File path")
     214    description = _("File path")
    219215
    220216    def __init__(self, verbose_name=None, name=None, upload_to='', storage=None, **kwargs):
    221217        for arg in ('primary_key', 'unique'):
    class ImageFieldFile(ImageFile, FieldFile):  
    321317class ImageField(FileField):
    322318    attr_class = ImageFieldFile
    323319    descriptor_class = ImageFileDescriptor
    324     description = ugettext_lazy("File path")
     320    description = _("File path")
    325321
    326322    def __init__(self, verbose_name=None, name=None, width_field=None, height_field=None, **kwargs):
    327323        self.width_field, self.height_field = width_field, height_field
  • django/db/models/fields/related.py

    diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
    index cedf308..e7f4b9b 100644
    a b  
    1 from django.conf import settings
    2 from django.db import connection, router, transaction
     1from django.db import connection, router
    32from django.db.backends import util
    43from django.db.models import signals, get_model
    54from django.db.models.fields import (AutoField, Field, IntegerField,
    from django.db.models.query import QuerySet  
    98from django.db.models.query_utils import QueryWrapper
    109from django.db.models.deletion import CASCADE
    1110from django.utils.encoding import smart_unicode
    12 from django.utils.translation import (ugettext_lazy as _, string_concat,
    13     ungettext, ugettext)
     11from django.utils.translation import ugettext_lazy as _, string_concat
    1412from django.utils.functional import curry
    1513from django.core import exceptions
    1614from django import forms
  • django/db/models/loading.py

    diff --git a/django/db/models/loading.py b/django/db/models/loading.py
    index 2c35fdb..03cdcc2 100644
    a b from django.utils.datastructures import SortedDict  
    66from django.utils.importlib import import_module
    77from django.utils.module_loading import module_has_submodule
    88
    9 import imp
    109import sys
    1110import os
    1211import threading
  • django/db/models/manager.py

    diff --git a/django/db/models/manager.py b/django/db/models/manager.py
    index 4fa4c4a..bdd86bb 100644
    a b  
    11import copy
    2 from django.conf import settings
    32from django.db import router
    43from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
    54from django.db.models import signals
  • django/db/models/query.py

    diff --git a/django/db/models/query.py b/django/db/models/query.py
    index 6a6a829..c719d13 100644
    a b The main QuerySet implementation. This provides the public API for the ORM.  
    33"""
    44
    55import copy
    6 from itertools import izip
    76
    87from django.db import connections, router, transaction, IntegrityError
    9 from django.db.models.aggregates import Aggregate
    10 from django.db.models.fields import DateField
    118from django.db.models.query_utils import (Q, select_related_descend,
    129    deferred_class_factory, InvalidQuery)
    1310from django.db.models.deletion import Collector
    14 from django.db.models import signals, sql
     11from django.db.models import sql
    1512
    1613# Used to control how many objects are worked with at once in some cases (e.g.
    1714# when deleting objects).
  • django/db/models/query_utils.py

    diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py
    index 69b19f1..a56ab5c 100644
    a b import weakref  
    1010
    1111from django.db.backends import util
    1212from django.utils import tree
    13 from django.utils.datastructures import SortedDict
    1413
    1514
    1615class InvalidQuery(Exception):
  • django/db/models/sql/compiler.py

    diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
    index 841ec12..b4502d8 100644
    a b from django.db.backends.util import truncate_name  
    55from django.db.models.sql.constants import *
    66from django.db.models.sql.datastructures import EmptyResultSet
    77from django.db.models.sql.expressions import SQLEvaluator
    8 from django.db.models.sql.query import get_proxied_model, get_order_dir, \
    9      select_related_descend, Query
     8from django.db.models.sql.query import (get_proxied_model, get_order_dir,
     9     select_related_descend, Query)
    1010from django.db.utils import DatabaseError
    1111
    1212class SQLCompiler(object):
  • django/db/models/sql/subqueries.py

    diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py
    index 003bf43..ecde857 100644
    a b Query subclasses which provide extra functionality beyond simple data retrieval.  
    33"""
    44
    55from django.core.exceptions import FieldError
    6 from django.db import connections
    76from django.db.models.fields import DateField, FieldDoesNotExist
    87from django.db.models.sql.constants import *
    98from django.db.models.sql.datastructures import Date
    10 from django.db.models.sql.expressions import SQLEvaluator
    119from django.db.models.sql.query import Query
    1210from django.db.models.sql.where import AND, Constraint
    1311
  • django/db/models/sql/where.py

    diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py
    index 2427a52..3e9dbf0 100644
    a b from itertools import repeat  
    66
    77from django.utils import tree
    88from django.db.models.fields import Field
    9 from django.db.models.query_utils import QueryWrapper
    109from datastructures import EmptyResultSet, FullResultSet
    1110
    1211# Connection types
  • django/db/transaction.py

    diff --git a/django/db/transaction.py b/django/db/transaction.py
    index 104243a..4ecd2d1 100644
    a b or implicit commits or rollbacks.  
    1313"""
    1414from __future__ import with_statement
    1515
    16 import sys
    1716from functools import wraps
    1817
    19 from django.conf import settings
    2018from django.db import connections, DEFAULT_DB_ALIAS
    2119
    2220
  • django/dispatch/saferef.py

    diff --git a/django/dispatch/saferef.py b/django/dispatch/saferef.py
    index f446447..1c7d164 100644
    a b Provides a way to safely weakref any function, including bound methods (which  
    55aren't handled by the core weakref module).
    66"""
    77
    8 import weakref, traceback
     8import traceback
     9import weakref
    910
    1011def safeRef(target, onDelete = None):
    1112    """Return a *safe* weak reference to a callable target
  • django/forms/extras/widgets.py

    diff --git a/django/forms/extras/widgets.py b/django/forms/extras/widgets.py
    index d75e903..5145578 100644
    a b  
    22Extra HTML Widget classes
    33"""
    44
    5 import time
    65import datetime
    76import re
    87
  • django/forms/models.py

    diff --git a/django/forms/models.py b/django/forms/models.py
    index b34f4d0..45e8d69 100644
    a b from django.utils.datastructures import SortedDict  
    88from django.utils.text import get_text_list, capfirst
    99from django.utils.translation import ugettext_lazy as _, ugettext
    1010
    11 from django.core.exceptions import ValidationError, NON_FIELD_ERRORS, \
    12                                    FieldError
     11from django.core.exceptions import ValidationError, NON_FIELD_ERRORS, FieldError
    1312from django.core.validators import EMPTY_VALUES
    1413from util import ErrorList
    1514from forms import BaseForm, get_declared_fields
  • django/middleware/http.py

    diff --git a/django/middleware/http.py b/django/middleware/http.py
    index e98858f..86e46ce 100644
    a b  
    1 from django.core.exceptions import MiddlewareNotUsed
    21from django.utils.http import http_date, parse_http_date_safe
    32
    43class ConditionalGetMiddleware(object):
  • django/template/base.py

    diff --git a/django/template/base.py b/django/template/base.py
    index b96e446..9a7f55f 100644
    a b  
    1 import imp
    21import re
    32from functools import partial
    43from inspect import getargspec
    from django.conf import settings  
    76from django.template.context import Context, RequestContext, ContextPopException
    87from django.utils.importlib import import_module
    98from django.utils.itercompat import is_iterable
    10 from django.utils.functional import Promise
    119from django.utils.text import smart_split, unescape_string_literal, get_text_list
    1210from django.utils.encoding import smart_unicode, force_unicode, smart_str
    1311from django.utils.translation import ugettext_lazy
  • django/template/context.py

    diff --git a/django/template/context.py b/django/template/context.py
    index cb1c708..8f70d70 100644
    a b  
    11from copy import copy
    22from django.core.exceptions import ImproperlyConfigured
    33from django.utils.importlib import import_module
    4 from django.http import HttpRequest
    54
    65# Cache of actual callables.
    76_standard_context_processors = None
  • django/template/debug.py

    diff --git a/django/template/debug.py b/django/template/debug.py
    index a9e3c4f..bf2a53b 100644
    a b  
    1 from django.conf import settings
    21from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
    32from django.utils.encoding import force_unicode
    43from django.utils.html import escape
  • django/template/defaulttags.py

    diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
    index 1eceaf4..df74b61 100644
    a b import re  
    55from datetime import datetime
    66from itertools import groupby, cycle as itertools_cycle
    77
    8 from django.template.base import Node, NodeList, Template, Context, Variable
    9 from django.template.base import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END, SINGLE_BRACE_START, SINGLE_BRACE_END, COMMENT_TAG_START, COMMENT_TAG_END
     8from django.template.base import Node, NodeList, Template
     9from django.template.base import (TemplateSyntaxError, VariableDoesNotExist,
     10        BLOCK_TAG_START, BLOCK_TAG_END,
     11        VARIABLE_TAG_START, VARIABLE_TAG_END,
     12        SINGLE_BRACE_START, SINGLE_BRACE_END,
     13        COMMENT_TAG_START, COMMENT_TAG_END)
    1014from django.template.base import get_library, Library, InvalidTemplateLibrary
    1115from django.template.smartif import IfParser, Literal
    1216from django.template.defaultfilters import date
  • django/template/loader_tags.py

    diff --git a/django/template/loader_tags.py b/django/template/loader_tags.py
    index f5cac33..3e2fb1b 100644
    a b  
    1 from django.template.base import TemplateSyntaxError, TemplateDoesNotExist, Variable
    2 from django.template.base import Library, Node, TextNode
    3 from django.template.context import Context
     1from django.template.base import TemplateSyntaxError, Library, Node, TextNode
    42from django.template.defaulttags import token_kwargs
    53from django.template.loader import get_template
    64from django.conf import settings
  • django/template/loaders/cached.py

    diff --git a/django/template/loaders/cached.py b/django/template/loaders/cached.py
    index 5b351ad..3ed9cf3 100644
    a b to load templates from them in order, caching the result.  
    44"""
    55
    66import hashlib
    7 from django.core.exceptions import ImproperlyConfigured
    87from django.template.base import TemplateDoesNotExist
    98from django.template.loader import BaseLoader, get_template_from_string, find_template_loader, make_origin
    10 from django.utils.importlib import import_module
    119
    1210class Loader(BaseLoader):
    1311    is_usable = True
  • django/template/smartif.py

    diff --git a/django/template/smartif.py b/django/template/smartif.py
    index e835e0f..54d74b4 100644
    a b  
    11"""
    22Parser and utilities for the smart 'if' tag
    33"""
    4 import operator
    54
    65# Using a simple top down parser, as described here:
    76#    http://effbot.org/zone/simple-top-down-parsing.htm.
  • django/templatetags/cache.py

    diff --git a/django/templatetags/cache.py b/django/templatetags/cache.py
    index 495623d..8183452 100644
    a b import hashlib  
    22from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist
    33from django.template import resolve_variable
    44from django.core.cache import cache
    5 from django.utils.encoding import force_unicode
    65from django.utils.http import urlquote
    76
    87register = Library()
  • django/templatetags/future.py

    diff --git a/django/templatetags/future.py b/django/templatetags/future.py
    index 3d98879..248c865 100644
    a b  
    1 from django.conf import settings
    2 from django.template import Library, Node, Template, TemplateSyntaxError
    3 from django.template.defaulttags import kwarg_re, include_is_allowed, SsiNode, URLNode
    4 from django.utils.encoding import smart_str
     1from django.template import Library, TemplateSyntaxError
     2from django.template.defaulttags import kwarg_re, SsiNode, URLNode
    53
    64
    75register = Library()
  • django/templatetags/i18n.py

    diff --git a/django/templatetags/i18n.py b/django/templatetags/i18n.py
    index 1782136..492e763 100644
    a b  
    11import re
    22
    3 from django.template import Node, Variable, VariableNode
     3from django.template import Node, Variable
    44from django.template import TemplateSyntaxError, TokenParser, Library
    55from django.template import TOKEN_TEXT, TOKEN_VAR
    66from django.template.base import _render_value_in_context
    77from django.utils import translation
    8 from django.utils.encoding import force_unicode
    98from django.template.defaulttags import token_kwargs
    109
    1110register = Library()
  • django/templatetags/l10n.py

    diff --git a/django/templatetags/l10n.py b/django/templatetags/l10n.py
    index 5191e69..12cf136 100644
    a b  
    1 from django.conf import settings
    21from django.template import Node
    32from django.template import TemplateSyntaxError, Library
    43from django.utils import formats
  • django/test/client.py

    diff --git a/django/test/client.py b/django/test/client.py
    index 4335f21..10d8727 100644
    a b import re  
    55import mimetypes
    66import warnings
    77from copy import copy
    8 from urlparse import urlparse, urlunparse, urlsplit
     8from urlparse import urlparse, urlsplit
    99try:
    1010    from cStringIO import StringIO
    1111except ImportError:
    from django.utils.encoding import smart_str  
    2424from django.utils.http import urlencode
    2525from django.utils.importlib import import_module
    2626from django.utils.itercompat import is_iterable
    27 from django.db import transaction, close_connection
     27from django.db import close_connection
    2828from django.test.utils import ContextList
    2929
    3030__all__ = ('Client', 'RequestFactory', 'encode_file', 'encode_multipart')
  • django/test/testcases.py

    diff --git a/django/test/testcases.py b/django/test/testcases.py
    index 02717ff..e767712 100644
    a b from functools import wraps  
    66from urlparse import urlsplit, urlunsplit
    77from xml.dom.minidom import parseString, Node
    88
    9 from django.conf import settings, UserSettingsHolder
     9from django.conf import settings
    1010from django.core import mail
    1111from django.core.management import call_command
    1212from django.core.signals import request_started
  • django/test/utils.py

    diff --git a/django/test/utils.py b/django/test/utils.py
    index 19a3190..180028a 100644
    a b  
    11from __future__ import with_statement
    22
    3 import sys
    4 import time
    5 import os
    63import warnings
    74from django.conf import settings, UserSettingsHolder
    85from django.core import mail
    9 from django.core.mail.backends import locmem
    106from django.test.signals import template_rendered, setting_changed
    117from django.template import Template, loader, TemplateDoesNotExist
    128from django.template.loaders import cached
  • django/utils/cache.py

    diff --git a/django/utils/cache.py b/django/utils/cache.py
    index bd23940..81a8279 100644
    a b from django.core.cache import get_cache  
    2626from django.utils.encoding import smart_str, iri_to_uri
    2727from django.utils.http import http_date
    2828from django.utils.translation import get_language
    29 from django.http import HttpRequest
    3029
    3130cc_delim_re = re.compile(r'\s*,\s*')
    3231
  • django/utils/log.py

    diff --git a/django/utils/log.py b/django/utils/log.py
    index 969a9d9..d25db69 100644
    a b  
    11import logging
    2 import sys
    32import traceback
    43
    54from django.conf import settings
  • django/utils/text.py

    diff --git a/django/utils/text.py b/django/utils/text.py
    index 00c999c..6c574b4 100644
    a b  
    11import re
     2from gzip import GzipFile
     3from htmlentitydefs import name2codepoint
     4
     5try:
     6    from cStringIO import StringIO
     7except ImportError:
     8    from StringIO import StringIO
     9
    210from django.utils.encoding import force_unicode
    311from django.utils.functional import allow_lazy
    412from django.utils.translation import ugettext_lazy, ugettext as _
    5 from htmlentitydefs import name2codepoint
     13
    614
    715# Capitalizes the first letter of a string.
    816capfirst = lambda x: x and force_unicode(x)[0].upper() + force_unicode(x)[1:]
    phone2numeric = allow_lazy(phone2numeric)  
    180188# From http://www.xhaus.com/alan/python/httpcomp.html#gzip
    181189# Used with permission.
    182190def compress_string(s):
    183     import cStringIO, gzip
    184     zbuf = cStringIO.StringIO()
    185     zfile = gzip.GzipFile(mode='wb', compresslevel=6, fileobj=zbuf)
     191    zbuf = StringIO()
     192    zfile = GzipFile(mode='wb', compresslevel=6, fileobj=zbuf)
    186193    zfile.write(s)
    187194    zfile.close()
    188195    return zbuf.getvalue()
  • django/utils/timesince.py

    diff --git a/django/utils/timesince.py b/django/utils/timesince.py
    index c584ce6..369a3e2 100644
    a b  
    11import datetime
    2 import time
    32
    43from django.utils.tzinfo import LocalTimezone
    54from django.utils.translation import ungettext, ugettext
  • django/utils/translation/trans_null.py

    diff --git a/django/utils/translation/trans_null.py b/django/utils/translation/trans_null.py
    index 5622c03..170cd5d 100644
    a b  
    22# that don't actually do anything. This is purely for performance, so that
    33# settings.USE_I18N = False can use this module rather than trans_real.py.
    44
    5 import warnings
    65from django.conf import settings
    76from django.utils.encoding import force_unicode
    87from django.utils.safestring import mark_safe, SafeData
  • django/utils/translation/trans_real.py

    diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
    index 9e8285b..345e46d 100644
    a b import locale  
    44import os
    55import re
    66import sys
    7 import warnings
    87import gettext as gettext_module
    9 from cStringIO import StringIO
    108from threading import local
    119
     10try:
     11    from cStringIO import StringIO
     12except ImportError:
     13    from StringIO import StringIO
     14
    1215from django.utils.importlib import import_module
    1316from django.utils.safestring import mark_safe, SafeData
    1417
  • django/utils/unittest/__init__.py

    diff --git a/django/utils/unittest/__init__.py b/django/utils/unittest/__init__.py
    index ac852a3..ac007b9 100644
    a b except ImportError:  
    5252
    5353        from django.utils.unittest.collector import collector
    5454        from django.utils.unittest.result import TestResult
    55         from django.utils.unittest.case import \
    56             TestCase, FunctionTestCase, SkipTest, skip, skipIf,\
    57             skipUnless, expectedFailure
     55        from django.utils.unittest.case import (TestCase, FunctionTestCase,
     56            SkipTest, skip, skipIf, skipUnless, expectedFailure)
    5857
    5958        from django.utils.unittest.suite import BaseTestSuite, TestSuite
    60         from django.utils.unittest.loader import \
    61             TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,\
    62             findTestCases
     59        from django.utils.unittest.loader import (TestLoader, defaultTestLoader,
     60            makeSuite, getTestCaseNames, findTestCases)
    6361
    6462        from django.utils.unittest.main import TestProgram, main, main_
    6563        from django.utils.unittest.runner import TextTestRunner, TextTestResult
    6664
    6765        try:
    68             from django.utils.unittest.signals import\
    69                 installHandler, registerResult, removeResult, removeHandler
     66            from django.utils.unittest.signals import (installHandler,
     67                registerResult, removeResult, removeHandler)
    7068        except ImportError:
    7169            # Compatibility with platforms that don't have the signal module
    7270            pass
  • django/utils/unittest/case.py

    diff --git a/django/utils/unittest/case.py b/django/utils/unittest/case.py
    index 78507c1..d81d666 100644
    a b from django.utils.unittest.util import\  
    1212    safe_repr, safe_str, strclass,\
    1313    unorderable_list_difference
    1414
    15 from django.utils.unittest.compatibility import wraps
     15from functools import wraps
    1616
    1717__unittest = True
    1818
  • django/utils/unittest/compatibility.py

    diff --git a/django/utils/unittest/compatibility.py b/django/utils/unittest/compatibility.py
    index a0dc499..b8d6397 100644
    a b  
    11import os
    22import sys
    33
    4 try:
    5     from functools import wraps
    6 except ImportError:
    7     # only needed for Python 2.4
    8     def wraps(_):
    9         def _wraps(func):
    10             return func
    11         return _wraps
     4# Backwards compatibility: Django used to re-define `wraps` for Python 2.4.
     5from functools import wraps
    126
    137__unittest = True
    148
  • django/utils/unittest/result.py

    diff --git a/django/utils/unittest/result.py b/django/utils/unittest/result.py
    index 2d2a1ad..2b8fae2 100644
    a b  
    33import sys
    44import traceback
    55import unittest
    6 
     6from functools import wraps
    77from StringIO import StringIO
    88
    99from django.utils.unittest import util
    10 from django.utils.unittest.compatibility import wraps
    1110
    1211__unittest = True
    1312
  • django/utils/unittest/signals.py

    diff --git a/django/utils/unittest/signals.py b/django/utils/unittest/signals.py
    index f1731ea..fc31043 100644
    a b  
    11import signal
    22import weakref
    33
    4 from django.utils.unittest.compatibility import wraps
     4from functools import wraps
    55
    66__unittest = True
    77
  • django/utils/version.py

    diff --git a/django/utils/version.py b/django/utils/version.py
    index 557135f..cb8623b 100644
    a b  
    11import django
    2 import os.path
    32import re
    43
    54def get_svn_revision(path=None):
  • django/views/debug.py

    diff --git a/django/views/debug.py b/django/views/debug.py
    index 490d4bb..58d271b 100644
    a b import os  
    33import re
    44import sys
    55import types
    6 from pprint import pformat
    76
    87from django.conf import settings
    98from django.http import (HttpResponse, HttpResponseServerError,
  • django/views/decorators/http.py

    diff --git a/django/views/decorators/http.py b/django/views/decorators/http.py
    index 6fc882e..495a7b1 100644
    a b Decorators for views based on HTTP headers.  
    33"""
    44
    55from calendar import timegm
    6 from datetime import timedelta
    76from functools import wraps
    87
    98from django.utils.decorators import decorator_from_middleware, available_attrs
  • django/views/generic/base.py

    diff --git a/django/views/generic/base.py b/django/views/generic/base.py
    index 6b52567..f2d4950 100644
    a b  
    11from functools import update_wrapper
    22from django import http
    33from django.core.exceptions import ImproperlyConfigured
    4 from django.template import RequestContext, loader
    54from django.template.response import TemplateResponse
    65from django.utils.log import getLogger
    76from django.utils.decorators import classonlymethod
  • django/views/generic/detail.py

    diff --git a/django/views/generic/detail.py b/django/views/generic/detail.py
    index 7e9047f..16e2c48 100644
    a b  
    1 import re
    2 
    31from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
    42from django.http import Http404
    53from django.utils.encoding import smart_str
  • django/views/generic/list.py

    diff --git a/django/views/generic/list.py b/django/views/generic/list.py
    index 5135763..9797356 100644
    a b  
    1 import re
    2 
    31from django.core.paginator import Paginator, InvalidPage
    42from django.core.exceptions import ImproperlyConfigured
    53from django.http import Http404
  • tests/modeltests/basic/models.py

    diff --git a/tests/modeltests/basic/models.py b/tests/modeltests/basic/models.py
    index 5f51fd8..26fddf0 100644
    a b  
    44
    55This is a basic model with only two non-primary-key fields.
    66"""
    7 from django.db import models, DEFAULT_DB_ALIAS, connection
     7from django.db import models
    88
    99class Article(models.Model):
    1010    headline = models.CharField(max_length=100, default='Default headline')
  • tests/modeltests/basic/tests.py

    diff --git a/tests/modeltests/basic/tests.py b/tests/modeltests/basic/tests.py
    index 966798d..ff09d9b 100644
    a b  
    11from datetime import datetime
    22
    33from django.core.exceptions import ObjectDoesNotExist
    4 from django.db import models, DEFAULT_DB_ALIAS, connection
    54from django.db.models.fields import FieldDoesNotExist
    65from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
    76
  • tests/modeltests/custom_pk/models.py

    diff --git a/tests/modeltests/custom_pk/models.py b/tests/modeltests/custom_pk/models.py
    index ff2f2ba..c514fd7 100644
    a b By default, Django adds an ``"id"`` field to each model. But you can override  
    66this behavior by explicitly adding ``primary_key=True`` to a field.
    77"""
    88
    9 from django.conf import settings
    10 from django.db import models, transaction, IntegrityError, DEFAULT_DB_ALIAS
     9from django.db import models
    1110
    1211from fields import MyAutoField
    1312
  • tests/modeltests/custom_pk/tests.py

    diff --git a/tests/modeltests/custom_pk/tests.py b/tests/modeltests/custom_pk/tests.py
    index c410ad1..6b94b6d 100644
    a b  
    11# -*- coding: utf-8 -*-
    2 from django.conf import settings
    3 from django.db import DEFAULT_DB_ALIAS, transaction, IntegrityError
     2from django.db import transaction, IntegrityError
    43from django.test import TestCase, skipIfDBFeature
    54
    65from models import Employee, Business, Bar, Foo
  • tests/modeltests/delete/models.py

    diff --git a/tests/modeltests/delete/models.py b/tests/modeltests/delete/models.py
    index ee9e999..f8b78eb 100644
    a b  
    1 from django.db import models, IntegrityError
     1from django.db import models
    22
    33
    44class R(models.Model):
  • tests/modeltests/field_subclassing/fields.py

    diff --git a/tests/modeltests/field_subclassing/fields.py b/tests/modeltests/field_subclassing/fields.py
    index 309648e..d6e4980 100644
    a b  
    1 from django.core.exceptions import FieldError
    21from django.db import models
    32from django.utils import simplejson as json
    43from django.utils.encoding import force_unicode
  • tests/modeltests/field_subclassing/models.py

    diff --git a/tests/modeltests/field_subclassing/models.py b/tests/modeltests/field_subclassing/models.py
    index b0d8336..c59c0d5 100644
    a b Tests for field subclassing.  
    55from django.db import models
    66from django.utils.encoding import force_unicode
    77
    8 from fields import Small, SmallField, SmallerField, JSONField
     8from fields import SmallField, SmallerField, JSONField
    99
    1010
    1111class MyModel(models.Model):
  • tests/modeltests/files/models.py

    diff --git a/tests/modeltests/files/models.py b/tests/modeltests/files/models.py
    index ca8965e..4134472 100644
    a b import random  
    99import tempfile
    1010
    1111from django.db import models
    12 from django.core.files.base import ContentFile
    1312from django.core.files.storage import FileSystemStorage
    1413
    1514
  • tests/modeltests/files/tests.py

    diff --git a/tests/modeltests/files/tests.py b/tests/modeltests/files/tests.py
    index 885f787..e8e7a76 100644
    a b  
    11from __future__ import with_statement
    22
    33import shutil
    4 import sys
    54import tempfile
    65
    76from django.core.cache import cache
  • tests/modeltests/fixtures/models.py

    diff --git a/tests/modeltests/fixtures/models.py b/tests/modeltests/fixtures/models.py
    index c8fd6a6..d2317d2 100644
    a b in the application directory, or in one of the directories named in the  
    1111from django.contrib.auth.models import Permission
    1212from django.contrib.contenttypes import generic
    1313from django.contrib.contenttypes.models import ContentType
    14 from django.db import models, DEFAULT_DB_ALIAS
    15 from django.conf import settings
     14from django.db import models
    1615
    1716
    1817class Category(models.Model):
  • tests/modeltests/fixtures/tests.py

    diff --git a/tests/modeltests/fixtures/tests.py b/tests/modeltests/fixtures/tests.py
    index 31f72f0..c335ffb 100644
    a b  
    11import StringIO
    2 import sys
    32
    4 from django.conf import settings
    53from django.contrib.sites.models import Site
    64from django.core import management
    7 from django.db import DEFAULT_DB_ALIAS
    85from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
    96
    10 from models import Article, Blog, Book, Category, Person, Spy, Tag, Visa
     7from models import Article, Book, Spy, Tag, Visa
    118
    129
    1310class TestCaseFixtureLoadingTests(TestCase):
  • tests/modeltests/fixtures_model_package/models/__init__.py

    diff --git a/tests/modeltests/fixtures_model_package/models/__init__.py b/tests/modeltests/fixtures_model_package/models/__init__.py
    index c0450b2..5cb0e4a 100644
    a b  
    11from django.db import models
    2 from django.conf import settings
    32
    43class Article(models.Model):
    54    headline = models.CharField(max_length=100, default='Default headline')
  • tests/modeltests/force_insert_update/models.py

    diff --git a/tests/modeltests/force_insert_update/models.py b/tests/modeltests/force_insert_update/models.py
    index 9516be7..e617aa2 100644
    a b  
    22Tests for forcing insert and update queries (instead of Django's normal
    33automatic behaviour).
    44"""
    5 from django.db import models, transaction, IntegrityError
     5from django.db import models
    66
    77class Counter(models.Model):
    88    name = models.CharField(max_length = 10)
  • tests/modeltests/get_object_or_404/models.py

    diff --git a/tests/modeltests/get_object_or_404/models.py b/tests/modeltests/get_object_or_404/models.py
    index eb3cd82..f62dd0c 100644
    a b performing a ``filter()`` lookup and raising a ``Http404`` exception if a  
    1111"""
    1212
    1313from django.db import models
    14 from django.http import Http404
    15 from django.shortcuts import get_object_or_404, get_list_or_404
    1614
    1715class Author(models.Model):
    1816    name = models.CharField(max_length=50)
  • tests/modeltests/get_or_create/models.py

    diff --git a/tests/modeltests/get_or_create/models.py b/tests/modeltests/get_or_create/models.py
    index db5719b..14f55f8 100644
    a b given parameters. If an object isn't found, it creates one with the given  
    66parameters.
    77"""
    88
    9 from django.db import models, IntegrityError
     9from django.db import models
    1010
    1111class Person(models.Model):
    1212    first_name = models.CharField(max_length=100)
  • tests/modeltests/lookup/models.py

    diff --git a/tests/modeltests/lookup/models.py b/tests/modeltests/lookup/models.py
    index d807531..82434bb 100644
    a b  
    44This demonstrates features of the database API.
    55"""
    66
    7 from django.db import models, DEFAULT_DB_ALIAS, connection
    8 from django.conf import settings
     7from django.db import models
    98
    109class Author(models.Model):
    1110    name = models.CharField(max_length=100)
  • tests/modeltests/lookup/tests.py

    diff --git a/tests/modeltests/lookup/tests.py b/tests/modeltests/lookup/tests.py
    index 3f40bf1..b05227c 100644
    a b  
    11from datetime import datetime
    22from operator import attrgetter
    33from django.core.exceptions import FieldError
    4 from django.db import connection
    54from django.test import TestCase, skipUnlessDBFeature
    65from models import Author, Article, Tag
    76
  • tests/modeltests/m2m_through/tests.py

    diff --git a/tests/modeltests/m2m_through/tests.py b/tests/modeltests/m2m_through/tests.py
    index 807e952..814e54f 100644
    a b from operator import attrgetter  
    33
    44from django.test import TestCase
    55
    6 from models import Person, Group, Membership, CustomMembership, \
    7     TestNoDefaultsOrNulls, PersonSelfRefM2M, Friendship
     6from models import (Person, Group, Membership, CustomMembership,
     7    PersonSelfRefM2M, Friendship)
    88
    99
    1010class M2mThroughTests(TestCase):
  • tests/modeltests/model_forms/models.py

    diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py
    index 7204b28..5dcc039 100644
    a b and the examples are probably a poor fit for the ``ModelForm`` syntax. In other  
    77words, most of these tests should be rewritten.
    88"""
    99
    10 import os
    1110import tempfile
    1211
    1312from django.db import models
  • tests/modeltests/model_formsets/tests.py

    diff --git a/tests/modeltests/model_formsets/tests.py b/tests/modeltests/model_formsets/tests.py
    index 6303e6d..34f8d47 100644
    a b from django.forms.models import (_get_foreign_key, inlineformset_factory,  
    1010from django.test import TestCase, skipUnlessDBFeature
    1111
    1212from modeltests.model_formsets.models import (
    13     Author, BetterAuthor, Book, BookWithCustomPK, Editor,
     13    Author, BetterAuthor, Book, BookWithCustomPK,
    1414    BookWithOptionalAltEditor, AlternateBook, AuthorMeeting, CustomPrimaryKey,
    1515    Place, Owner, Location, OwnerProfile, Restaurant, Product, Price,
    1616    MexicanRestaurant, ClassyMexicanRestaurant, Repository, Revision,
  • tests/modeltests/mutually_referential/tests.py

    diff --git a/tests/modeltests/mutually_referential/tests.py b/tests/modeltests/mutually_referential/tests.py
    index 101d67c..365c741 100644
    a b  
    11from django.test import TestCase
    2 from models import Parent, Child
     2from models import Parent
    33
    44class MutuallyReferentialTests(TestCase):
    55
  • tests/modeltests/one_to_one/models.py

    diff --git a/tests/modeltests/one_to_one/models.py b/tests/modeltests/one_to_one/models.py
    index f263735..246c3fc 100644
    a b To define a one-to-one relationship, use ``OneToOneField()``.  
    66In this example, a ``Place`` optionally can be a ``Restaurant``.
    77"""
    88
    9 from django.db import models, transaction, IntegrityError
     9from django.db import models
    1010
    1111class Place(models.Model):
    1212    name = models.CharField(max_length=50)
  • tests/modeltests/pagination/tests.py

    diff --git a/tests/modeltests/pagination/tests.py b/tests/modeltests/pagination/tests.py
    index eaee466..1129052 100644
    a b  
    11from datetime import datetime
    2 from operator import attrgetter
    32
    43from django.core.paginator import Paginator, InvalidPage, EmptyPage
    54from django.test import TestCase
  • tests/modeltests/proxy_model_inheritance/tests.py

    diff --git a/tests/modeltests/proxy_model_inheritance/tests.py b/tests/modeltests/proxy_model_inheritance/tests.py
    index 7426f41..546c507 100644
    a b apps and calls syncdb, then verifies that the table has been created.  
    99import os
    1010import sys
    1111
    12 from django.conf import settings, Settings
     12from django.conf import settings
    1313from django.core.management import call_command
    1414from django.db.models.loading import load_app
    1515from django.test import TransactionTestCase
  • tests/modeltests/proxy_models/models.py

    diff --git a/tests/modeltests/proxy_models/models.py b/tests/modeltests/proxy_models/models.py
    index 90d54d9..4fc9c6d 100644
    a b than using a new table of their own. This allows them to act as simple proxies,  
    55providing a modified interface to the data from the base class.
    66"""
    77
    8 from django.contrib.contenttypes.models import ContentType
    98from django.db import models
    109
    1110
  • tests/modeltests/serializers/tests.py

    diff --git a/tests/modeltests/serializers/tests.py b/tests/modeltests/serializers/tests.py
    index 013438e..bd528fc 100644
    a b from django.db import transaction  
    99from django.test import TestCase, TransactionTestCase, Approximate
    1010from django.utils import simplejson, unittest
    1111
    12 from models import Category, Author, Article, AuthorProfile, Actor, \
    13                                     Movie, Score, Player, Team
     12from models import Category, Author, Article, AuthorProfile, Actor, Movie, Score, Player, Team
    1413
    1514class SerializerRegistrationTests(unittest.TestCase):
    1615    def setUp(self):
  • tests/modeltests/transactions/models.py

    diff --git a/tests/modeltests/transactions/models.py b/tests/modeltests/transactions/models.py
    index d957fe1..b2ae396 100644
    a b commit-on-success behavior. Alternatively, you can manage the transaction  
    77manually.
    88"""
    99
    10 from django.db import models, DEFAULT_DB_ALIAS
     10from django.db import models
    1111
    1212class Reporter(models.Model):
    1313    first_name = models.CharField(max_length=30)
  • tests/modeltests/transactions/tests.py

    diff --git a/tests/modeltests/transactions/tests.py b/tests/modeltests/transactions/tests.py
    index db58b80..5cebe67 100644
    a b  
    11from __future__ import with_statement
    22
    3 import sys
    4 
    5 from django.db import connection, transaction, IntegrityError, DEFAULT_DB_ALIAS
    6 from django.conf import settings
     3from django.db import connection, transaction, IntegrityError
    74from django.test import TransactionTestCase, skipUnlessDBFeature
    85
    96from models import Reporter
  • tests/modeltests/unmanaged_models/tests.py

    diff --git a/tests/modeltests/unmanaged_models/tests.py b/tests/modeltests/unmanaged_models/tests.py
    index dee3799..b9817ef 100644
    a b  
    11from django.test import TestCase
    22from django.db import connection
    3 from models import Unmanaged1, Unmanaged2, Managed1
    4 from models import A01, A02, B01, B02, C01, C02
     3from models import A01, A02, B01, B02, C01, C02, Unmanaged2, Managed1
    54
    65class SimpleTests(TestCase):
    76
  • tests/modeltests/validation/models.py

    diff --git a/tests/modeltests/validation/models.py b/tests/modeltests/validation/models.py
    index f92fc1f..52e1f97 100644
    a b  
    11from datetime import datetime
    22from django.core.exceptions import ValidationError
    33from django.db import models
    4 from django.test import TestCase
    54
    65
    76def validate_answer_to_universe(value):
  • tests/modeltests/validation/validators.py

    diff --git a/tests/modeltests/validation/validators.py b/tests/modeltests/validation/validators.py
    index 6a7d833..30ce661 100644
    a b  
    1 from django.utils.unittest import TestCase
    2 
    31from modeltests.validation import ValidationTestCase
    42from models import *
    53
  • tests/regressiontests/admin_filters/tests.py

    diff --git a/tests/regressiontests/admin_filters/tests.py b/tests/regressiontests/admin_filters/tests.py
    index 5095abb..b4c4f34 100644
    a b  
    1 from __future__ import with_statement
    2 
    31import datetime
    42
    53from django.core.exceptions import ImproperlyConfigured
  • tests/regressiontests/admin_validation/tests.py

    diff --git a/tests/regressiontests/admin_validation/tests.py b/tests/regressiontests/admin_validation/tests.py
    index 2cf3c60..ef391ff 100644
    a b  
    11from django.contrib import admin
    22from django import forms
    3 from django.contrib.admin.validation import validate, validate_inline, \
    4                                             ImproperlyConfigured
     3from django.contrib.admin.validation import validate, validate_inline, ImproperlyConfigured
    54from django.test import TestCase
    65
    76from models import Song, Book, Album, TwoAlbumFKAndAnE, State, City
  • tests/regressiontests/bash_completion/management/commands/test_command.py

    diff --git a/tests/regressiontests/bash_completion/management/commands/test_command.py b/tests/regressiontests/bash_completion/management/commands/test_command.py
    index 5cb8820..0f57506 100644
    a b  
    1 import sys, os
    2 from optparse import OptionParser, make_option
     1from optparse import make_option
    32
    43from django.core.management.base import BaseCommand
    54
  • tests/regressiontests/comment_tests/tests/comment_utils_moderators_tests.py

    diff --git a/tests/regressiontests/comment_tests/tests/comment_utils_moderators_tests.py b/tests/regressiontests/comment_tests/tests/comment_utils_moderators_tests.py
    index 4177163..9d6a9e7 100644
    a b  
    1 from regressiontests.comment_tests.tests import CommentTestCase, CT, Site
    2 from django.contrib.comments.forms import CommentForm
     1from regressiontests.comment_tests.tests import CommentTestCase
    32from django.contrib.comments.models import Comment
    43from django.contrib.comments.moderation import moderator, CommentModerator, AlreadyModerated
    54from regressiontests.comment_tests.models import Entry
  • tests/regressiontests/comment_tests/tests/feed_tests.py

    diff --git a/tests/regressiontests/comment_tests/tests/feed_tests.py b/tests/regressiontests/comment_tests/tests/feed_tests.py
    index 2dccbcd..4497f95 100644
    a b  
    1 import warnings
    2 
    3 from django.test.utils import get_warnings_state, restore_warnings_state
    4 
    51from regressiontests.comment_tests.tests import CommentTestCase
    62
    73
  • tests/regressiontests/comment_tests/tests/templatetag_tests.py

    diff --git a/tests/regressiontests/comment_tests/tests/templatetag_tests.py b/tests/regressiontests/comment_tests/tests/templatetag_tests.py
    index 0ead6c2..0ee34ac 100644
    a b  
    11from django.contrib.comments.forms import CommentForm
    2 from django.contrib.comments.models import Comment
    32from django.contrib.contenttypes.models import ContentType
    43from django.template import Template, Context
    54from regressiontests.comment_tests.models import Article, Author
  • tests/regressiontests/csrf_tests/tests.py

    diff --git a/tests/regressiontests/csrf_tests/tests.py b/tests/regressiontests/csrf_tests/tests.py
    index b3238a7..c5f9f36 100644
    a b  
    11# -*- coding: utf-8 -*-
    22from __future__ import with_statement
    3 import warnings
    43
    54from django.test import TestCase
    65from django.http import HttpRequest, HttpResponse
  • tests/regressiontests/datatypes/tests.py

    diff --git a/tests/regressiontests/datatypes/tests.py b/tests/regressiontests/datatypes/tests.py
    index e161be9..2d40fec 100644
    a b  
    11import datetime
    22
    3 from django.conf import settings
    4 from django.db import DEFAULT_DB_ALIAS
    53from django.test import TestCase, skipIfDBFeature
    64from django.utils import tzinfo
    75
  • tests/regressiontests/defer_regress/models.py

    diff --git a/tests/regressiontests/defer_regress/models.py b/tests/regressiontests/defer_regress/models.py
    index 4e4ab0a..1d1a224 100644
    a b  
    22Regression tests for defer() / only() behavior.
    33"""
    44
    5 from django.conf import settings
    6 from django.contrib.contenttypes.models import ContentType
    7 from django.db import connection, models
     5from django.db import models
    86
    97class Item(models.Model):
    108    name = models.CharField(max_length=15)
  • tests/regressiontests/defer_regress/tests.py

    diff --git a/tests/regressiontests/defer_regress/tests.py b/tests/regressiontests/defer_regress/tests.py
    index fbcf85e..2135522 100644
    a b  
    11from operator import attrgetter
    22
    3 from django.conf import settings
    43from django.contrib.contenttypes.models import ContentType
    54from django.contrib.sessions.backends.db import SessionStore
    6 from django.db import connection
    75from django.db.models.loading import cache
    86from django.test import TestCase
    97
  • tests/regressiontests/delete_regress/tests.py

    diff --git a/tests/regressiontests/delete_regress/tests.py b/tests/regressiontests/delete_regress/tests.py
    index ec26676..22b4833 100644
    a b  
    11import datetime
    22
    33from django.conf import settings
    4 from django.db import backend, connection, transaction, DEFAULT_DB_ALIAS
     4from django.db import backend, transaction, DEFAULT_DB_ALIAS
    55from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
    66
    77from models import (Book, Award, AwardNote, Person, Child, Toy, PlayedWith,
    8     PlayedWithNote, Contact, Email, Researcher, Food, Eaten,
     8    PlayedWithNote, Email, Researcher, Food, Eaten,
    99    Policy, Version, Location, Item)
    1010
    1111
  • tests/regressiontests/expressions_regress/tests.py

    diff --git a/tests/regressiontests/expressions_regress/tests.py b/tests/regressiontests/expressions_regress/tests.py
    index a900c6c..497a843 100644
    a b Spanning tests for all the operations that F() expressions can perform.  
    33"""
    44import datetime
    55
    6 from django.conf import settings
    7 from django.db import models, connection
     6from django.db import connection
    87from django.db.models import F
    98from django.test import TestCase, Approximate, skipUnlessDBFeature
    109
  • tests/regressiontests/extra_regress/tests.py

    diff --git a/tests/regressiontests/extra_regress/tests.py b/tests/regressiontests/extra_regress/tests.py
    index ef7cbb8..5f779be 100644
    a b from django.test import TestCase  
    33from django.utils.datastructures import SortedDict
    44
    55from django.contrib.auth.models import User
    6 from regressiontests.extra_regress.models import TestObject, Order, \
    7         RevisionableModel
     6from regressiontests.extra_regress.models import TestObject, Order, RevisionableModel
    87
    98import datetime
    109
  • tests/regressiontests/file_storage/tests.py

    diff --git a/tests/regressiontests/file_storage/tests.py b/tests/regressiontests/file_storage/tests.py
    index 917d2f3..40710eb 100644
    a b except ImportError:  
    1818
    1919from django.conf import settings
    2020from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
    21 from django.core.files.base import ContentFile, File
     21from django.core.files.base import ContentFile
    2222from django.core.files.images import get_image_dimensions
    2323from django.core.files.storage import FileSystemStorage, get_storage_class
    2424from django.core.files.uploadedfile import UploadedFile
  • tests/regressiontests/fixtures_regress/models.py

    diff --git a/tests/regressiontests/fixtures_regress/models.py b/tests/regressiontests/fixtures_regress/models.py
    index 2dfb550..b353f80 100644
    a b  
    1 from django.db import models, DEFAULT_DB_ALIAS, connection
     1from django.db import models
    22from django.contrib.auth.models import User
    3 from django.conf import settings
    43
    54
    65class Animal(models.Model):
  • tests/regressiontests/fixtures_regress/tests.py

    diff --git a/tests/regressiontests/fixtures_regress/tests.py b/tests/regressiontests/fixtures_regress/tests.py
    index 3dc4ede..a565ec9 100644
    a b  
    22# Unittests for fixtures.
    33import os
    44import re
    5 import sys
    65try:
    76    from cStringIO import StringIO
    87except ImportError:
    from django.core.management.commands.dumpdata import sort_dependencies  
    1312from django.core.management.base import CommandError
    1413from django.db.models import signals
    1514from django.db import transaction
    16 from django.test import TestCase, TransactionTestCase, skipIfDBFeature, \
    17     skipUnlessDBFeature
     15from django.test import (TestCase, TransactionTestCase, skipIfDBFeature,
     16    skipUnlessDBFeature)
    1817
    1918from models import Animal, Stuff
    2019from models import Absolute, Parent, Child
  • tests/regressiontests/forms/localflavor/cl.py

    diff --git a/tests/regressiontests/forms/localflavor/cl.py b/tests/regressiontests/forms/localflavor/cl.py
    index b2b4562..59e4824 100644
    a b  
    11from django.contrib.localflavor.cl.forms import CLRutField, CLRegionSelect
    2 from django.core.exceptions import ValidationError
    32
    43from utils import LocalFlavorTestCase
    54
  • tests/regressiontests/forms/tests/fields.py

    diff --git a/tests/regressiontests/forms/tests/fields.py b/tests/regressiontests/forms/tests/fields.py
    index ad8d1d9..152a13e 100644
    a b Other than that, the Field subclasses have class-specific options for  
    2525__init__(). For example, CharField has a max_length option.
    2626"""
    2727import datetime
    28 import time
    2928import re
    3029import os
    3130import urllib2
    from decimal import Decimal  
    3332
    3433from django.core.files.uploadedfile import SimpleUploadedFile
    3534from django.forms import *
    36 from django.forms.widgets import RadioFieldRenderer
    3735from django.utils.unittest import TestCase
    3836
    3937
  • tests/regressiontests/forms/tests/forms.py

    diff --git a/tests/regressiontests/forms/tests/forms.py b/tests/regressiontests/forms/tests/forms.py
    index 91a7472..ce4004e 100644
    a b  
    11# -*- coding: utf-8 -*-
    22import datetime
    3 from decimal import Decimal
    4 import re
    5 import time
    63from django.core.files.uploadedfile import SimpleUploadedFile
    74from django.forms import *
    85from django.http import QueryDict
  • tests/regressiontests/forms/tests/models.py

    diff --git a/tests/regressiontests/forms/tests/models.py b/tests/regressiontests/forms/tests/models.py
    index 3f548df..5e1bd82 100644
    a b import datetime  
    33from django.core.files.uploadedfile import SimpleUploadedFile
    44from django.forms import Form, ModelForm, FileField, ModelChoiceField
    55from django.test import TestCase
    6 from regressiontests.forms.models import ChoiceModel, ChoiceOptionModel, ChoiceFieldModel, FileModel, Group, BoundaryModel, Defaults
     6from regressiontests.forms.models import (ChoiceOptionModel, ChoiceFieldModel,
     7    FileModel, Group, BoundaryModel, Defaults)
    78
    89
    910class ChoiceFieldForm(ModelForm):
  • tests/regressiontests/forms/tests/widgets.py

    diff --git a/tests/regressiontests/forms/tests/widgets.py b/tests/regressiontests/forms/tests/widgets.py
    index 0a8a879..b4ceb2f 100644
    a b  
    22
    33import copy
    44import datetime
    5 import re
    6 import time
    7 from decimal import Decimal
    85from django.conf import settings
    96from django.core.files.uploadedfile import SimpleUploadedFile
    107from django.forms import *
  • tests/regressiontests/generic_inline_admin/tests.py

    diff --git a/tests/regressiontests/generic_inline_admin/tests.py b/tests/regressiontests/generic_inline_admin/tests.py
    index c40b6dd..b037ebe 100644
    a b from django.contrib.contenttypes.generic import generic_inlineformset_factory  
    55from django.test import TestCase
    66
    77# local test models
    8 from models import Episode, EpisodeExtra, EpisodeMaxNum, EpisodeExclude, \
    9                    Media, EpisodePermanent, MediaPermanentInline, Category
     8from models import (Episode, EpisodeExtra, EpisodeMaxNum, EpisodeExclude,
     9    Media, EpisodePermanent, MediaPermanentInline, Category)
    1010
    1111
    1212class GenericAdminViewTest(TestCase):
  • tests/regressiontests/generic_relations_regress/tests.py

    diff --git a/tests/regressiontests/generic_relations_regress/tests.py b/tests/regressiontests/generic_relations_regress/tests.py
    index 45e8674..52731a9 100644
    a b  
    11from django.test import TestCase
    2 from django.contrib.contenttypes.models import ContentType
    32from django.db.models import Q
    43from models import *
    54
  • tests/regressiontests/generic_views/base.py

    diff --git a/tests/regressiontests/generic_views/base.py b/tests/regressiontests/generic_views/base.py
    index fc5cf62..40490a4 100644
    a b import unittest  
    44from django.core.exceptions import ImproperlyConfigured
    55from django.http import HttpResponse
    66from django.test import TestCase, RequestFactory
    7 from django.utils import simplejson
    87from django.views.generic import View, TemplateView, RedirectView
    98
    109
  • tests/regressiontests/generic_views/dates.py

    diff --git a/tests/regressiontests/generic_views/dates.py b/tests/regressiontests/generic_views/dates.py
    index 5b784f6..b9608d6 100644
    a b  
    11import datetime
    2 import random
    32
    43from django.core.exceptions import ImproperlyConfigured
    54from django.test import TestCase
  • tests/regressiontests/generic_views/list.py

    diff --git a/tests/regressiontests/generic_views/list.py b/tests/regressiontests/generic_views/list.py
    index c41680c..f5bf910 100644
    a b from django.core.exceptions import ImproperlyConfigured  
    22from django.test import TestCase
    33
    44from regressiontests.generic_views.models import Author, Artist
    5 from regressiontests.generic_views.views import CustomPaginator
    65
    76class ListViewTests(TestCase):
    87    fixtures = ['generic-views-test-data.json']
  • tests/regressiontests/i18n/forms.py

    diff --git a/tests/regressiontests/i18n/forms.py b/tests/regressiontests/i18n/forms.py
    index 156441c..600f252 100644
    a b  
    1 from django import template, forms
     1from django import forms
    22from django.forms.extras import SelectDateWidget
     3
    34from models import Company
    45
    56class I18nForm(forms.Form):
  • tests/regressiontests/i18n/tests.py

    diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
    index e3add3e..194825f 100644
    a b from __future__ import with_statement  
    33import datetime
    44import decimal
    55import os
    6 import sys
    76import pickle
    87from threading import local
    98
  • tests/regressiontests/introspection/tests.py

    diff --git a/tests/regressiontests/introspection/tests.py b/tests/regressiontests/introspection/tests.py
    index e309a98..4f5fb09 100644
    a b  
    11from functools import update_wrapper
    2 from django.conf import settings
    3 from django.db import connection, DEFAULT_DB_ALIAS
     2from django.db import connection
    43from django.test import TestCase, skipUnlessDBFeature
    54
    65from models import Reporter, Article
  • tests/regressiontests/localflavor/tests.py

    diff --git a/tests/regressiontests/localflavor/tests.py b/tests/regressiontests/localflavor/tests.py
    index 6a02d99..6a15d46 100644
    a b  
    1 from django.test import TestCase
    2 from django.utils import unittest
    3 
    4 # just import your tests here
    51from au.tests import *
    62from mk.tests import *
    73from us.tests import *
  • tests/regressiontests/m2m_through_regress/models.py

    diff --git a/tests/regressiontests/m2m_through_regress/models.py b/tests/regressiontests/m2m_through_regress/models.py
    index 121ef22..ff71348 100644
    a b  
    1 from datetime import datetime
    2 
    31from django.contrib.auth.models import User
    4 from django.core import management
    52from django.db import models
    63
    74
  • tests/regressiontests/max_lengths/tests.py

    diff --git a/tests/regressiontests/max_lengths/tests.py b/tests/regressiontests/max_lengths/tests.py
    index 59d98d6..f743378 100644
    a b  
    1 from django.db import DatabaseError
    21from django.utils import unittest
    32from regressiontests.max_lengths.models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths
    43
  • tests/regressiontests/middleware_exceptions/models.py

    diff --git a/tests/regressiontests/middleware_exceptions/models.py b/tests/regressiontests/middleware_exceptions/models.py
    index 137941f..e69de29 100644
    a b  
    1 from django.db import models
  • tests/regressiontests/model_fields/imagefield.py

    diff --git a/tests/regressiontests/model_fields/imagefield.py b/tests/regressiontests/model_fields/imagefield.py
    index dd79e7a..c952aa9 100644
    a b import os  
    22import shutil
    33
    44from django.core.files import File
    5 from django.core.files.base import ContentFile
    65from django.core.files.images import ImageFile
    76from django.test import TestCase
    87
    9 from models import Image, Person, PersonWithHeight, PersonWithHeightAndWidth, \
    10         PersonDimensionsFirst, PersonTwoImages, TestImageFieldFile
     8from models import (Image, Person, PersonWithHeight, PersonWithHeightAndWidth,
     9        PersonDimensionsFirst, PersonTwoImages, TestImageFieldFile)
    1110
    1211
    1312# If PIL available, do these tests.
  • tests/regressiontests/model_fields/tests.py

    diff --git a/tests/regressiontests/model_fields/tests.py b/tests/regressiontests/model_fields/tests.py
    index b42c0af..3e9d614 100644
    a b from models import Foo, Bar, Whiz, BigD, BigS, Image, BigInt, Post, NullBooleanM  
    1212
    1313# If PIL available, do these tests.
    1414if Image:
    15     from imagefield import \
    16             ImageFieldTests, \
    17             ImageFieldTwoDimensionsTests, \
    18             ImageFieldNoDimensionsTests, \
    19             ImageFieldOneDimensionTests, \
    20             ImageFieldDimensionsFirstTests, \
    21             ImageFieldUsingFileTests, \
    22             TwoImageFieldTests
     15    from imagefield import (
     16            ImageFieldTests,
     17            ImageFieldTwoDimensionsTests,
     18            ImageFieldNoDimensionsTests,
     19            ImageFieldOneDimensionTests,
     20            ImageFieldDimensionsFirstTests,
     21            ImageFieldUsingFileTests,
     22            TwoImageFieldTests)
    2323
    2424
    2525class BasicFieldTests(test.TestCase):
  • tests/regressiontests/model_forms_regress/tests.py

    diff --git a/tests/regressiontests/model_forms_regress/tests.py b/tests/regressiontests/model_forms_regress/tests.py
    index 9817858..9860c2e 100644
    a b from django.forms.models import (modelform_factory, ModelChoiceField,  
    88from django.utils import unittest
    99from django.test import TestCase
    1010
    11 from models import Person, RealPerson, Triple, FilePathModel, Article, \
    12     Publication, CustomFF, Author, Author1, Homepage, Document, Edition
     11from models import (Person, RealPerson, Triple, FilePathModel, Article,
     12    Publication, CustomFF, Author, Author1, Homepage, Document, Edition)
    1313
    1414
    1515class ModelMultipleChoiceFieldTests(TestCase):
  • tests/regressiontests/modeladmin/models.py

    diff --git a/tests/regressiontests/modeladmin/models.py b/tests/regressiontests/modeladmin/models.py
    index 26eaaae..ae180a4 100644
    a b  
    11# coding: utf-8
    2 from datetime import date
    3 
    42from django.db import models
    53from django.contrib.auth.models import User
    64
  • tests/regressiontests/multiple_database/models.py

    diff --git a/tests/regressiontests/multiple_database/models.py b/tests/regressiontests/multiple_database/models.py
    index ce71828..8146c57 100644
    a b  
    1 from django.conf import settings
    21from django.contrib.auth.models import User
    32from django.contrib.contenttypes.models import ContentType
    43from django.contrib.contenttypes import generic
  • tests/regressiontests/multiple_database/tests.py

    diff --git a/tests/regressiontests/multiple_database/tests.py b/tests/regressiontests/multiple_database/tests.py
    index 551a677..74b928a 100644
    a b  
    11import datetime
    22import pickle
    3 import sys
    43from StringIO import StringIO
    54
    65from django.conf import settings
    from django.contrib.auth.models import User  
    87from django.core import management
    98from django.db import connections, router, DEFAULT_DB_ALIAS
    109from django.db.models import signals
    11 from django.db.utils import ConnectionRouter
    1210from django.test import TestCase
    1311
    1412from models import Book, Person, Pet, Review, UserProfile
  • tests/regressiontests/select_related_onetoone/tests.py

    diff --git a/tests/regressiontests/select_related_onetoone/tests.py b/tests/regressiontests/select_related_onetoone/tests.py
    index ab35fec..3e7023a 100644
    a b  
    1 from django import db
    2 from django.conf import settings
    31from django.test import TestCase
    42
    53from models import (User, UserProfile, UserStat, UserStatResult, StatDetails,
  • tests/regressiontests/serializers_regress/tests.py

    diff --git a/tests/regressiontests/serializers_regress/tests.py b/tests/regressiontests/serializers_regress/tests.py
    index 90a438c..cd2ce3c 100644
    a b try:  
    1515except ImportError:
    1616    from StringIO import StringIO
    1717
    18 from django.conf import settings
    19 from django.core import serializers, management
     18from django.core import serializers
    2019from django.core.serializers import SerializerDoesNotExist
    21 from django.db import transaction, DEFAULT_DB_ALIAS, connection
     20from django.db import connection
    2221from django.test import TestCase
    2322from django.utils.functional import curry
    2423
  • tests/regressiontests/signals_regress/tests.py

    diff --git a/tests/regressiontests/signals_regress/tests.py b/tests/regressiontests/signals_regress/tests.py
    index 630b16f..332f5d9 100644
    a b  
    1 import sys
    2 from StringIO import StringIO
    31from django.test import TestCase
    42
    53from django.db import models
  • tests/regressiontests/syndication/tests.py

    diff --git a/tests/regressiontests/syndication/tests.py b/tests/regressiontests/syndication/tests.py
    index 2f90dc0..6643298 100644
    a b  
    1 import datetime
    2 import warnings
    31from xml.dom import minidom
    42
    53from django.contrib.syndication import views
  • tests/regressiontests/templates/custom.py

    diff --git a/tests/regressiontests/templates/custom.py b/tests/regressiontests/templates/custom.py
    index 74c39ab..d781874 100644
    a b  
    1 from __future__ import with_statement
    2 
    31from django import template
    42from django.utils.unittest import TestCase
    53from templatetags import custom
  • tests/regressiontests/templates/loaders.py

    diff --git a/tests/regressiontests/templates/loaders.py b/tests/regressiontests/templates/loaders.py
    index 1773592..c2ae0bd 100644
    a b import pkg_resources  
    1414import imp
    1515import StringIO
    1616import os.path
    17 import warnings
    1817
    1918from django.template import TemplateDoesNotExist, Context
    2019from django.template.loaders.eggs import Loader as EggLoader
    2120from django.template import loader
    22 from django.test.utils import get_warnings_state, restore_warnings_state
    2321from django.utils import unittest
    2422
    2523
  • tests/regressiontests/templates/response.py

    diff --git a/tests/regressiontests/templates/response.py b/tests/regressiontests/templates/response.py
    index 6fc2ded..a1257fe 100644
    a b from django.utils import unittest  
    66from django.test import RequestFactory, TestCase
    77from django.conf import settings
    88import django.template.context
    9 from django.template import Template, Context, RequestContext
     9from django.template import Template, Context
    1010from django.template.response import (TemplateResponse, SimpleTemplateResponse,
    1111                                      ContentNotRenderedError)
    1212
  • tests/regressiontests/templates/smartif.py

    diff --git a/tests/regressiontests/templates/smartif.py b/tests/regressiontests/templates/smartif.py
    index 2ce2df3..3a705ca 100644
    a b  
    1 from django.template.smartif import IfParser, Literal
     1from django.template.smartif import IfParser
    22from django.utils import unittest
    33
    44class SmartIfTests(unittest.TestCase):
  • tests/regressiontests/templates/tests.py

    diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
    index 36a1ca3..4ed7c53 100644
    a b import traceback  
    1414import warnings
    1515
    1616from django import template
    17 from django.template import base as template_base
     17from django.template import base as template_base, RequestContext
    1818from django.core import urlresolvers
    1919from django.template import loader
    2020from django.template.loaders import app_directories, filesystem, cached
    21 from django.test.utils import get_warnings_state, restore_warnings_state,\
    22     setup_test_template_loader, restore_template_loaders
     21from django.test.utils import (get_warnings_state, restore_warnings_state,
     22    setup_test_template_loader, restore_template_loaders)
    2323from django.utils import unittest
    2424from django.utils.formats import date_format
    2525from django.utils.translation import activate, deactivate, ugettext as _
  • tests/regressiontests/test_utils/tests.py

    diff --git a/tests/regressiontests/test_utils/tests.py b/tests/regressiontests/test_utils/tests.py
    index 673295b..a35b0bc 100644
    a b  
    11from __future__ import with_statement
    22
    3 import sys
    4 
    5 from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
     3from django.test import TestCase, skipUnlessDBFeature
    64from django.utils.unittest import skip
    75
    86from models import Person
  • tests/regressiontests/urlpatterns_reverse/middleware.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/middleware.py b/tests/regressiontests/urlpatterns_reverse/middleware.py
    index cd3c045..7bc42f8 100644
    a b  
    1 from django.core.urlresolvers import set_urlconf
    2 
    31import urlconf_inner
    42
    53class ChangeURLconfMiddleware(object):
  • tests/regressiontests/urlpatterns_reverse/tests.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/tests.py b/tests/regressiontests/urlpatterns_reverse/tests.py
    index 31a928c..3db14d3 100644
    a b Unit tests for reverse URL lookups.  
    33"""
    44from django.conf import settings
    55from django.core.exceptions import ImproperlyConfigured
    6 from django.core.urlresolvers import reverse, resolve, NoReverseMatch,\
    7                                      Resolver404, ResolverMatch,\
    8                                      RegexURLResolver, RegexURLPattern
     6from django.core.urlresolvers import (reverse, resolve, NoReverseMatch,
     7    Resolver404, ResolverMatch, RegexURLResolver, RegexURLPattern)
    98from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
    109from django.shortcuts import redirect
    1110from django.test import TestCase
  • tests/regressiontests/utils/jslex.py

    diff --git a/tests/regressiontests/utils/jslex.py b/tests/regressiontests/utils/jslex.py
    index 08e8386..7cd93ca 100644
    a b  
    22# encoding: utf-8
    33# originally from https://bitbucket.org/ned/jslex
    44
    5 import difflib
    65from django.test import TestCase
    76from django.utils.jslex import JsLexer, prepare_js_for_gettext
    87
  • tests/regressiontests/views/tests/debug.py

    diff --git a/tests/regressiontests/views/tests/debug.py b/tests/regressiontests/views/tests/debug.py
    index 1dbaff4..ac12fbd 100644
    a b from django.test import TestCase, RequestFactory  
    99from django.core.urlresolvers import reverse
    1010from django.template import TemplateSyntaxError
    1111from django.views.debug import ExceptionReporter
    12 from django.core.exceptions import ImproperlyConfigured
    1312from django.core import mail
    1413
    1514from regressiontests.views import BrokenException, except_args
  • tests/regressiontests/views/tests/defaults.py

    diff --git a/tests/regressiontests/views/tests/defaults.py b/tests/regressiontests/views/tests/defaults.py
    index c7c295a..6378cf9 100644
    a b  
    1 from os import path
    2 
    3 from django.conf import settings
    41from django.test import TestCase
    52from django.contrib.contenttypes.models import ContentType
    63
Back to Top