summaryrefslogtreecommitdiff
path: root/django/contrib/contenttypes
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2017-01-07 12:11:46 +0100
committerClaude Paroz <claude@2xlibre.net>2017-01-18 21:33:28 +0100
commit2b281cc35ed9d997614ca3c416928d7fabfef1ad (patch)
treed3e73cf44b15139aa9f1f53e398942ba64f5e190 /django/contrib/contenttypes
parent7b2f2e74adb36a4334e83130f6abc2f79d395235 (diff)
Refs #23919 -- Removed most of remaining six usage
Thanks Tim Graham for the review.
Diffstat (limited to 'django/contrib/contenttypes')
-rw-r--r--django/contrib/contenttypes/checks.py3
-rw-r--r--django/contrib/contenttypes/management/__init__.py3
-rw-r--r--django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py4
3 files changed, 3 insertions, 7 deletions
diff --git a/django/contrib/contenttypes/checks.py b/django/contrib/contenttypes/checks.py
index 2355a5e943..d21df40f46 100644
--- a/django/contrib/contenttypes/checks.py
+++ b/django/contrib/contenttypes/checks.py
@@ -1,7 +1,6 @@
from itertools import chain
from django.apps import apps
-from django.utils import six
def check_generic_foreign_keys(app_configs=None, **kwargs):
@@ -13,7 +12,7 @@ def check_generic_foreign_keys(app_configs=None, **kwargs):
models = chain.from_iterable(app_config.get_models() for app_config in app_configs)
errors = []
fields = (
- obj for model in models for obj in six.itervalues(vars(model))
+ obj for model in models for obj in vars(model).values()
if isinstance(obj, GenericForeignKey)
)
for field in fields:
diff --git a/django/contrib/contenttypes/management/__init__.py b/django/contrib/contenttypes/management/__init__.py
index d0d5b52f09..6799ef8a23 100644
--- a/django/contrib/contenttypes/management/__init__.py
+++ b/django/contrib/contenttypes/management/__init__.py
@@ -1,7 +1,6 @@
from django.apps import apps as global_apps
from django.db import DEFAULT_DB_ALIAS, migrations, router, transaction
from django.db.utils import IntegrityError
-from django.utils import six
class RenameContentType(migrations.RunPython):
@@ -126,7 +125,7 @@ def create_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT
app_label=app_label,
model=model_name,
)
- for (model_name, model) in six.iteritems(app_models)
+ for (model_name, model) in app_models.items()
if model_name not in content_types
]
ContentType.objects.using(using).bulk_create(cts)
diff --git a/django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py b/django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py
index 2a3b23b0d0..e5f77dc7df 100644
--- a/django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py
+++ b/django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py
@@ -3,8 +3,6 @@ from django.contrib.contenttypes.models import ContentType
from django.core.management import BaseCommand
from django.db import DEFAULT_DB_ALIAS, router
from django.db.models.deletion import Collector
-from django.utils import six
-from django.utils.six.moves import input
from ...management import get_contenttypes_and_models
@@ -32,7 +30,7 @@ class Command(BaseCommand):
if not app_models:
continue
to_remove = [
- ct for (model_name, ct) in six.iteritems(content_types)
+ ct for (model_name, ct) in content_types.items()
if model_name not in app_models
]
# Confirm that the content type is stale before deletion.