Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refs #23919 -- Removed python_2_unicode_compatible decorator usage #7871

Merged
merged 1 commit into from Jan 18, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -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)
@@ -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>')
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.