mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 03:20:12 +03:00
dropped python 2.7 compat codes
This commit is contained in:
parent
7e87449077
commit
5a6747d02b
|
@ -3,11 +3,9 @@ import os
|
|||
|
||||
from django.conf import settings
|
||||
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 Token(models.Model):
|
||||
"""
|
||||
The default authorization token model.
|
||||
|
|
|
@ -6,9 +6,8 @@ from django.db.models import Manager
|
|||
from django.db.models.query import QuerySet
|
||||
from django.urls import NoReverseMatch, Resolver404, get_script_prefix, resolve
|
||||
from django.utils import six
|
||||
from django.utils.encoding import (
|
||||
python_2_unicode_compatible, smart_text, uri_to_iri
|
||||
)
|
||||
from django.utils.encoding import smart_text, uri_to_iri
|
||||
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
@ -67,7 +66,6 @@ class Hyperlink(six.text_type):
|
|||
is_hyperlink = True
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class PKOnlyObject(object):
|
||||
"""
|
||||
This is a mock object, used for when we only need the pk of the object
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from django.test import TestCase
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from rest_framework.compat import apply_markdown
|
||||
from rest_framework.utils.formatting import dedent
|
||||
|
@ -153,7 +152,7 @@ class TestViewNamesAndDescriptions(TestCase):
|
|||
"""
|
||||
# use a mock object instead of gettext_lazy to ensure that we can't end
|
||||
# up with a test case string in our l10n catalog
|
||||
@python_2_unicode_compatible
|
||||
|
||||
class MockLazyStr(object):
|
||||
def __init__(self, string):
|
||||
self.s = string
|
||||
|
|
|
@ -4,12 +4,10 @@ from django.contrib.contenttypes.fields import (
|
|||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import models
|
||||
from django.test import TestCase
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from rest_framework import serializers
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Tag(models.Model):
|
||||
"""
|
||||
Tags have a descriptive slug, and are attached to an arbitrary object.
|
||||
|
@ -23,7 +21,6 @@ class Tag(models.Model):
|
|||
return self.tag
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Bookmark(models.Model):
|
||||
"""
|
||||
A URL bookmark that may have multiple tags attached.
|
||||
|
@ -35,7 +32,6 @@ class Bookmark(models.Model):
|
|||
return 'Bookmark: %s' % self.url
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Note(models.Model):
|
||||
"""
|
||||
A textual note that may have multiple tags attached.
|
||||
|
|
Loading…
Reference in New Issue
Block a user