Permalink
Browse files

Refs #23919 -- Removed python_2_unicode_compatible decorator usage

  • Loading branch information...
claudep committed Nov 19, 2016
1 parent d7b9aaa commit f3c43ad1fd9556f0fd026a5dfa93c67a5cf186ca
Showing with 23 additions and 757 deletions.
  1. +1 −2 django/contrib/admin/models.py
  2. +1 −2 django/contrib/admin/options.py
  3. +1 −2 django/contrib/auth/base_user.py
  4. +0 −4 django/contrib/auth/models.py
  5. +1 −2 django/contrib/contenttypes/fields.py
  6. +1 −2 django/contrib/contenttypes/models.py
  7. +1 −2 django/contrib/flatpages/models.py
  8. +0 −2 django/contrib/gis/db/backends/base/models.py
  9. +0 −2 django/contrib/gis/db/backends/oracle/models.py
  10. +0 −2 django/contrib/gis/db/backends/postgis/models.py
  11. +0 −2 django/contrib/gis/db/backends/spatialite/models.py
  12. +1 −4 django/contrib/gis/gdal/raster/source.py
  13. +1 −2 django/contrib/messages/storage/base.py
  14. +0 −2 django/contrib/redirects/models.py
  15. +0 −2 django/contrib/sessions/base_session.py
  16. +0 −2 django/contrib/sites/models.py
  17. +0 −4 django/contrib/sites/requests.py
  18. +1 −2 django/core/checks/messages.py
  19. +1 −5 django/core/files/base.py
  20. +0 −2 django/core/files/uploadhandler.py
  21. +0 −2 django/db/migrations/exceptions.py
  22. +0 −3 django/db/migrations/graph.py
  23. +0 −2 django/db/migrations/migration.py
  24. +0 −2 django/db/migrations/recorder.py
  25. +1 −4 django/db/models/base.py
  26. +1 −4 django/db/models/fields/__init__.py
  27. +0 −2 django/db/models/manager.py
  28. +1 −2 django/db/models/options.py
  29. +1 −3 django/forms/boundfield.py
  30. +1 −2 django/forms/forms.py
  31. +0 −2 django/forms/formsets.py
  32. +1 −3 django/forms/utils.py
  33. +1 −4 django/forms/widgets.py
  34. +1 −4 django/template/base.py
  35. +1 −3 django/test/html.py
  36. +0 −4 docs/internals/contributing/writing-code/coding-style.txt
  37. +0 −3 docs/intro/tutorial02.txt
  38. +0 −5 docs/ref/models/instances.txt
  39. +0 −27 docs/ref/unicode.txt
  40. +0 −21 docs/topics/python3.txt
  41. +0 −3 tests/admin_changelist/models.py
  42. +0 −2 tests/admin_checks/models.py
  43. +0 −2 tests/admin_custom_urls/models.py
  44. +0 −6 tests/admin_filters/models.py
  45. +0 −4 tests/admin_inlines/models.py
  46. +0 −3 tests/admin_utils/models.py
  47. +0 −37 tests/admin_views/models.py
  48. +0 −9 tests/admin_widgets/models.py
  49. +0 −5 tests/aggregation/models.py
  50. +0 −6 tests/aggregation_regress/models.py
  51. +0 −9 tests/annotations/models.py
  52. +0 −2 tests/auth_tests/models/custom_permissions.py
  53. +0 −2 tests/auth_tests/models/custom_user.py
  54. +0 −8 tests/backends/models.py
  55. +0 −3 tests/basic/models.py
  56. +0 −2 tests/choices/models.py
  57. +0 −9 tests/contenttypes_tests/models.py
  58. +0 −3 tests/custom_columns/models.py
  59. +0 −3 tests/custom_lookups/models.py
  60. +0 −8 tests/custom_managers/models.py
  61. +0 −2 tests/custom_methods/models.py
  62. +0 −2 tests/custom_pk/fields.py
  63. +0 −4 tests/custom_pk/models.py
  64. +0 −2 tests/datatypes/models.py
  65. +0 −3 tests/dates/models.py
  66. +0 −3 tests/datetimes/models.py
  67. +0 −5 tests/db_functions/models.py
  68. +0 −2 tests/defer/models.py
  69. +0 −4 tests/defer_regress/models.py
  70. +0 −2 tests/delete/models.py
  71. +0 −5 tests/distinct_on_fields/models.py
  72. +0 −8 tests/expressions/models.py
  73. +0 −5 tests/expressions_case/models.py
  74. +0 −3 tests/extra_regress/models.py
  75. +0 −2 tests/field_defaults/models.py
  76. +0 −8 tests/fixtures/models.py
  77. +0 −2 tests/fixtures_model_package/models/__init__.py
  78. +0 −10 tests/fixtures_regress/models.py
  79. +0 −2 tests/foreign_object/models/article.py
  80. +0 −2 tests/foreign_object/models/empty_join.py
  81. +0 −5 tests/foreign_object/models/person.py
  82. +0 −3 tests/forms_tests/models.py
  83. +0 −2 tests/forms_tests/tests/test_error_messages.py
  84. +1 −2 tests/forms_tests/tests/test_forms.py
  85. +1 −2 tests/forms_tests/tests/test_utils.py
  86. +0 −6 tests/forms_tests/widget_tests/test_clearablefileinput.py
  87. +0 −2 tests/from_db_value/models.py
  88. +0 −2 tests/generic_inline_admin/models.py
  89. +0 −6 tests/generic_relations/models.py
  90. +0 −8 tests/generic_relations_regress/models.py
  91. +0 −4 tests/generic_views/models.py
  92. +0 −3 tests/get_object_or_404/models.py
  93. +0 −2 tests/get_or_create/models.py
  94. +0 −2 tests/gis_tests/distapp/models.py
  95. +0 −2 tests/gis_tests/geo3d/models.py
  96. +0 −2 tests/gis_tests/geoadmin/models.py
  97. +0 −2 tests/gis_tests/geoapp/models.py
  98. +0 −2 tests/gis_tests/geogapp/models.py
  99. +0 −2 tests/gis_tests/layermap/models.py
  100. +0 −4 tests/gis_tests/relatedapp/models.py
  101. +0 −3 tests/inline_formsets/models.py
  102. +0 −5 tests/introspection/models.py
  103. +0 −5 tests/lookup/models.py
  104. +0 −2 tests/m2m_and_m2o/models.py
  105. +0 −4 tests/m2m_intermediary/models.py
  106. +0 −3 tests/m2m_multiple/models.py
  107. +0 −2 tests/m2m_recursive/models.py
  108. +0 −6 tests/m2m_regress/models.py
  109. +0 −4 tests/m2m_signals/models.py
  110. +0 −8 tests/m2m_through/models.py
  111. +0 −8 tests/m2m_through_regress/models.py
  112. +0 −3 tests/m2o_recursive/models.py
  113. +1 −9 tests/managers_regress/models.py
  114. +0 −4 tests/many_to_many/models.py
  115. +0 −7 tests/many_to_one/models.py
  116. +0 −3 tests/many_to_one_null/models.py
  117. +0 −2 tests/migrations/models.py
  118. +0 −17 tests/model_forms/models.py
  119. +0 −19 tests/model_formsets/models.py
  120. +0 −2 tests/model_formsets_regress/models.py
  121. +0 −9 tests/model_inheritance/models.py
  122. +0 −11 tests/model_inheritance_regress/models.py
  123. +0 −5 tests/model_regress/models.py
  124. +0 −2 tests/modeladmin/models.py
  125. +0 −5 tests/multiple_database/models.py
  126. +0 −3 tests/null_fk/models.py
  127. +0 −4 tests/null_fk_ordering/models.py
  128. +0 −3 tests/null_queries/models.py
  129. +0 −7 tests/one_to_one/models.py
  130. +0 −2 tests/or_lookups/models.py
  131. +0 −3 tests/order_with_respect_to/models.py
  132. +0 −2 tests/ordering/models.py
  133. +0 −2 tests/pagination/models.py
  134. +0 −11 tests/prefetch_related/models.py
  135. +0 −6 tests/proxy_models/models.py
  136. +0 −39 tests/queries/models.py
  137. +0 −2 tests/reserved_names/models.py
  138. +0 −4 tests/reverse_lookup/models.py
  139. +0 −2 tests/save_delete_hooks/models.py
  140. +0 −2 tests/schema/models.py
  141. +0 −14 tests/select_related/models.py
  142. +0 −10 tests/select_related_onetoone/models.py
  143. +0 −8 tests/select_related_regress/models.py
  144. +0 −10 tests/serializers/models/base.py
  145. +0 −5 tests/signals/models.py
  146. +0 −2 tests/sites_framework/models.py
  147. +0 −2 tests/str/models.py
  148. +1 −7 tests/str/tests.py
  149. +0 −7 tests/string_lookup/models.py
  150. +0 −3 tests/syndication_tests/models.py
  151. +0 −3 tests/template_tests/filter_tests/test_unordered_list.py
  152. +0 −4 tests/template_tests/utils.py
  153. +0 −4 tests/test_utils/models.py
  154. +0 −2 tests/transaction_hooks/models.py
  155. +0 −2 tests/transactions/models.py
  156. +0 −7 tests/unmanaged_models/models.py
  157. +0 −3 tests/update/models.py
  158. +0 −3 tests/update_only_fields/models.py
  159. +0 −2 tests/validation/models.py
  160. +0 −3 tests/view_tests/models.py
@@ -6,7 +6,7 @@
from django.db import models
from django.urls import NoReverseMatch, reverse
from django.utils import timezone
-from django.utils.encoding import force_text, python_2_unicode_compatible
+from django.utils.encoding import force_text
from django.utils.text import get_text_list
from django.utils.translation import ugettext, ugettext_lazy as _
@@ -31,7 +31,6 @@ def log_action(self, user_id, content_type_id, object_id, object_repr, action_fl
)
-@python_2_unicode_compatible
class LogEntry(models.Model):
action_time = models.DateTimeField(
_('action time'),
@@ -38,7 +38,7 @@
from django.urls import reverse
from django.utils import six
from django.utils.decorators import method_decorator
-from django.utils.encoding import force_text, python_2_unicode_compatible
+from django.utils.encoding import force_text
from django.utils.html import format_html
from django.utils.http import urlencode, urlquote
from django.utils.safestring import mark_safe
@@ -480,7 +480,6 @@ def has_module_permission(self, request):
return request.user.has_module_perms(self.opts.app_label)
-@python_2_unicode_compatible
class ModelAdmin(BaseModelAdmin):
"Encapsulates all admin options and functionality for a given model."
@@ -10,7 +10,7 @@
)
from django.db import models
from django.utils.crypto import get_random_string, salted_hmac
-from django.utils.encoding import force_text, python_2_unicode_compatible
+from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
@@ -45,7 +45,6 @@ def get_by_natural_key(self, username):
return self.get(**{self.model.USERNAME_FIELD: username})
-@python_2_unicode_compatible
class AbstractBaseUser(models.Model):
password = models.CharField(_('password'), max_length=128)
last_login = models.DateTimeField(_('last login'), blank=True, null=True)
@@ -7,7 +7,6 @@
from django.db import models
from django.db.models.manager import EmptyManager
from django.utils import six, timezone
-from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from .validators import ASCIIUsernameValidator, UnicodeUsernameValidator
@@ -35,7 +34,6 @@ def get_by_natural_key(self, codename, app_label, model):
)
-@python_2_unicode_compatible
class Permission(models.Model):
"""
The permissions system provides a way to assign permissions to specific
@@ -96,7 +94,6 @@ def get_by_natural_key(self, name):
return self.get(name=name)
-@python_2_unicode_compatible
class Group(models.Model):
"""
Groups are a generic way of categorizing users to apply permissions, or
@@ -374,7 +371,6 @@ class Meta(AbstractUser.Meta):
swappable = 'AUTH_USER_MODEL'
-@python_2_unicode_compatible
class AnonymousUser(object):
id = None
pk = None
@@ -11,11 +11,10 @@
lazy_related_operation,
)
from django.db.models.query_utils import PathInfo
-from django.utils.encoding import force_text, python_2_unicode_compatible
+from django.utils.encoding import force_text
from django.utils.functional import cached_property
-@python_2_unicode_compatible
class GenericForeignKey(object):
"""
Provide a generic many-to-one relation through the ``content_type`` and
@@ -2,7 +2,7 @@
from django.apps import apps
from django.db import models
-from django.utils.encoding import force_text, python_2_unicode_compatible
+from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
@@ -133,7 +133,6 @@ def _add_to_cache(self, using, ct):
self._cache.setdefault(using, {})[ct.id] = ct
-@python_2_unicode_compatible
class ContentType(models.Model):
app_label = models.CharField(max_length=100)
model = models.CharField(_('python model class name'), max_length=100)
@@ -1,11 +1,10 @@
from django.contrib.sites.models import Site
from django.db import models
from django.urls import get_script_prefix
-from django.utils.encoding import iri_to_uri, python_2_unicode_compatible
+from django.utils.encoding import iri_to_uri
from django.utils.translation import ugettext_lazy as _
-@python_2_unicode_compatible
class FlatPage(models.Model):
url = models.CharField(_('URL'), max_length=100, db_index=True)
title = models.CharField(_('title'), max_length=200)
@@ -1,9 +1,7 @@
from django.contrib.gis import gdal
from django.utils import six
-from django.utils.encoding import python_2_unicode_compatible
-@python_2_unicode_compatible
class SpatialRefSysMixin(object):
"""
The SpatialRefSysMixin is a class used by the database-dependent
@@ -9,10 +9,8 @@
"""
from django.contrib.gis.db import models
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
-from django.utils.encoding import python_2_unicode_compatible
-@python_2_unicode_compatible
class OracleGeometryColumns(models.Model):
"Maps to the Oracle USER_SDO_GEOM_METADATA table."
table_name = models.CharField(max_length=32)
@@ -3,10 +3,8 @@
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.db import models
-from django.utils.encoding import python_2_unicode_compatible
-@python_2_unicode_compatible
class PostGISGeometryColumns(models.Model):
"""
The 'geometry_columns' view from PostGIS. See the PostGIS
@@ -3,10 +3,8 @@
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.db import models
-from django.utils.encoding import python_2_unicode_compatible
-@python_2_unicode_compatible
class SpatialiteGeometryColumns(models.Model):
"""
The 'geometry_columns' table from SpatiaLite.
@@ -11,9 +11,7 @@
from django.contrib.gis.gdal.srs import SpatialReference, SRSException
from django.contrib.gis.geometry.regex import json_regex
from django.utils import six
-from django.utils.encoding import (
- force_bytes, force_text, python_2_unicode_compatible,
-)
+from django.utils.encoding import force_bytes, force_text
from django.utils.functional import cached_property
@@ -52,7 +50,6 @@ def y(self, value):
self._raster.geotransform = gtf
-@python_2_unicode_compatible
class GDALRaster(GDALBase):
"""
Wraps a raster GDAL Data Source object.
@@ -1,11 +1,10 @@
from django.conf import settings
from django.contrib.messages import constants, utils
-from django.utils.encoding import force_text, python_2_unicode_compatible
+from django.utils.encoding import force_text
LEVEL_TAGS = utils.get_level_tags()
-@python_2_unicode_compatible
class Message(object):
"""
Represents an actual message that can be stored in any of the supported
@@ -1,10 +1,8 @@
from django.contrib.sites.models import Site
from django.db import models
-from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
-@python_2_unicode_compatible
class Redirect(models.Model):
site = models.ForeignKey(Site, models.CASCADE, verbose_name=_('site'))
old_path = models.CharField(
@@ -3,7 +3,6 @@
when django.contrib.sessions is not in INSTALLED_APPS.
"""
from django.db import models
-from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@@ -24,7 +23,6 @@ def save(self, session_key, session_dict, expire_date):
return s
-@python_2_unicode_compatible
class AbstractBaseSession(models.Model):
session_key = models.CharField(_('session key'), max_length=40, primary_key=True)
session_data = models.TextField(_('session data'))
@@ -4,7 +4,6 @@
from django.db import models
from django.db.models.signals import pre_delete, pre_save
from django.http.request import split_domain_port
-from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
SITE_CACHE = {}
@@ -78,7 +77,6 @@ def get_by_natural_key(self, domain):
return self.get(domain=domain)
-@python_2_unicode_compatible
class Site(models.Model):
domain = models.CharField(
@@ -1,7 +1,3 @@
-from django.utils.encoding import python_2_unicode_compatible
-
-
-@python_2_unicode_compatible
class RequestSite(object):
"""
A class that shares the primary interface of Site (i.e., it has
@@ -1,4 +1,4 @@
-from django.utils.encoding import force_str, python_2_unicode_compatible
+from django.utils.encoding import force_str
# Levels
DEBUG = 10
@@ -8,7 +8,6 @@
CRITICAL = 50
-@python_2_unicode_compatible
class CheckMessage(object):
def __init__(self, level, msg, hint=None, obj=None, id=None):
@@ -3,12 +3,9 @@
from django.core.files.utils import FileProxyMixin
from django.utils import six
-from django.utils.encoding import (
- force_bytes, force_str, force_text, python_2_unicode_compatible,
-)
+from django.utils.encoding import force_bytes, force_str, force_text
-@python_2_unicode_compatible
class File(FileProxyMixin):
DEFAULT_CHUNK_SIZE = 64 * 2 ** 10
@@ -138,7 +135,6 @@ def close(self):
self.file.close()
-@python_2_unicode_compatible
class ContentFile(File):
"""
A File-like object that takes just raw content, rather than an actual file.
@@ -8,7 +8,6 @@
from django.core.files.uploadedfile import (
InMemoryUploadedFile, TemporaryUploadedFile,
)
-from django.utils.encoding import python_2_unicode_compatible
from django.utils.module_loading import import_string
__all__ = [
@@ -25,7 +24,6 @@ class UploadFileException(Exception):
pass
-@python_2_unicode_compatible
class StopUpload(UploadFileException):
"""
This exception is raised when an upload must abort.
@@ -1,5 +1,4 @@
from django.db.utils import DatabaseError
-from django.utils.encoding import python_2_unicode_compatible
class AmbiguityError(Exception):
@@ -44,7 +43,6 @@ class IrreversibleError(RuntimeError):
pass
-@python_2_unicode_compatible
class NodeNotFoundError(LookupError):
"""
Raised when an attempt on a node is made that is not available in the graph.
@@ -6,7 +6,6 @@
from django.db.migrations.state import ProjectState
from django.utils import six
from django.utils.datastructures import OrderedSet
-from django.utils.encoding import python_2_unicode_compatible
from .exceptions import CircularDependencyError, NodeNotFoundError
@@ -18,7 +17,6 @@
)
-@python_2_unicode_compatible
@total_ordering
class Node(object):
"""
@@ -102,7 +100,6 @@ def raise_error(self):
raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
-@python_2_unicode_compatible
class MigrationGraph(object):
"""
Represents the digraph of all migrations in a project.
@@ -1,10 +1,8 @@
from django.db.transaction import atomic
-from django.utils.encoding import python_2_unicode_compatible
from .exceptions import IrreversibleError
-@python_2_unicode_compatible
class Migration(object):
"""
The base class for all migrations.
@@ -1,7 +1,6 @@
from django.apps.registry import Apps
from django.db import models
from django.db.utils import DatabaseError
-from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import now
from .exceptions import MigrationSchemaMissing
@@ -20,7 +19,6 @@ class MigrationRecorder(object):
a row in the table always means a migration is applied.
"""
- @python_2_unicode_compatible
class Migration(models.Model):
app = models.CharField(max_length=255)
name = models.CharField(max_length=255)
View
@@ -27,17 +27,14 @@
)
from django.db.models.utils import make_model_tuple
from django.utils import six
-from django.utils.encoding import (
- force_str, force_text, python_2_unicode_compatible,
-)
+from django.utils.encoding import force_str, force_text
from django.utils.functional import curry
from django.utils.six.moves import zip
from django.utils.text import capfirst, get_text_list
from django.utils.translation import ugettext_lazy as _
from django.utils.version import get_version
-@python_2_unicode_compatible
class Deferred(object):
def __repr__(self):
return str('<Deferred field>')
Oops, something went wrong.

0 comments on commit f3c43ad

Please sign in to comment.