-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed custom StringIO, force_text, smart_text compat
- Loading branch information
Showing
15 changed files
with
31 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,31 +9,19 @@ | |
import inspect | ||
|
||
from django.core.exceptions import ImproperlyConfigured | ||
from django.utils.encoding import force_text | ||
from django.conf import settings | ||
from django.utils import six | ||
import django | ||
|
||
|
||
# Handle django.utils.encoding rename in 1.5 onwards. | ||
# smart_unicode -> smart_text | ||
# force_unicode -> force_text | ||
try: | ||
from django.utils.encoding import smart_text | ||
except ImportError: | ||
from django.utils.encoding import smart_unicode as smart_text | ||
try: | ||
from django.utils.encoding import force_text | ||
except ImportError: | ||
from django.utils.encoding import force_unicode as force_text | ||
|
||
|
||
# OrderedDict only available in Python 2.7. | ||
# This will always be the case in Django 1.7 and above, as these versions | ||
# no longer support Python 2.6. | ||
# For Django <= 1.6 and Python 2.6 fall back to OrderedDict. | ||
try: | ||
from collections import OrderedDict | ||
except: | ||
except ImportError: | ||
from django.utils.datastructures import SortedDict as OrderedDict | ||
|
||
|
||
|
@@ -72,21 +60,13 @@ def clean_manytomany_helptext(text): | |
pass | ||
|
||
|
||
# cStringIO only if it's available, otherwise StringIO | ||
try: | ||
import cStringIO.StringIO as StringIO | ||
except ImportError: | ||
StringIO = six.StringIO | ||
|
||
BytesIO = six.BytesIO | ||
|
||
|
||
# urlparse compat import (Required because it changed in python 3.x) | ||
try: | ||
from urllib import parse as urlparse | ||
except ImportError: | ||
import urlparse | ||
|
||
|
||
# UserDict moves in Python 3 | ||
try: | ||
from UserDict import UserDict | ||
|
@@ -104,14 +84,6 @@ def get_model_name(model_cls): | |
return model_cls._meta.module_name | ||
|
||
|
||
def get_concrete_model(model_cls): | ||
try: | ||
return model_cls._meta.concrete_model | ||
except AttributeError: | ||
# 1.3 does not include concrete model | ||
return model_cls | ||
|
||
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
maryokhin
Author
Contributor
|
||
# View._allowed_methods only present from 1.5 onwards | ||
if django.VERSION >= (1, 5): | ||
from django.views.generic import View | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why has the get_concrete_model method been removed ? Is it replaced by something else ?