diff --git a/django/contrib/admin/checks.py b/django/contrib/admin/checks.py index 0d5db6c7868..0102ce9a57d 100644 --- a/django/contrib/admin/checks.py +++ b/django/contrib/admin/checks.py @@ -560,7 +560,7 @@ class ModelAdminChecks(BaseModelAdminChecks): def _check_inlines_item(self, obj, model, inline, label): """ Check one inline model admin. """ - inline_label = '.'.join([inline.__module__, inline.__name__]) + inline_label = inline.__module__ + '.' + inline.__name__ from django.contrib.admin.options import InlineModelAdmin diff --git a/django/contrib/auth/base_user.py b/django/contrib/auth/base_user.py index cf3c71d7512..8865b671c91 100644 --- a/django/contrib/auth/base_user.py +++ b/django/contrib/auth/base_user.py @@ -26,7 +26,7 @@ class BaseUserManager(models.Manager): except ValueError: pass else: - email = '@'.join([email_name, domain_part.lower()]) + email = email_name + '@' + domain_part.lower() return email def make_random_password(self, length=10, diff --git a/django/contrib/contenttypes/forms.py b/django/contrib/contenttypes/forms.py index 60e6d794b57..4970ab452b2 100644 --- a/django/contrib/contenttypes/forms.py +++ b/django/contrib/contenttypes/forms.py @@ -13,10 +13,10 @@ class BaseGenericInlineFormSet(BaseModelFormSet): prefix=None, queryset=None, **kwargs): opts = self.model._meta self.instance = instance - self.rel_name = '-'.join(( - opts.app_label, opts.model_name, - self.ct_field.name, self.ct_fk_field.name, - )) + self.rel_name = ( + opts.app_label + '-' + opts.model_name + '-' + + self.ct_field.name + '-' + self.ct_fk_field.name + ) if self.instance is None or self.instance.pk is None: qs = self.model._default_manager.none() else: @@ -32,7 +32,10 @@ class BaseGenericInlineFormSet(BaseModelFormSet): @classmethod def get_default_prefix(cls): opts = cls.model._meta - return '-'.join((opts.app_label, opts.model_name, cls.ct_field.name, cls.ct_fk_field.name)) + return ( + opts.app_label + '-' + opts.model_name + '-' + + cls.ct_field.name + '-' + cls.ct_fk_field.name + ) def save_new(self, form, commit=True): setattr(form.instance, self.ct_field.get_attname(), ContentType.objects.get_for_model(self.instance).pk) diff --git a/django/db/models/query.py b/django/db/models/query.py index 10952195db5..cd9709c1fa2 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -1282,8 +1282,8 @@ class Prefetch: return obj_dict def add_prefix(self, prefix): - self.prefetch_through = LOOKUP_SEP.join([prefix, self.prefetch_through]) - self.prefetch_to = LOOKUP_SEP.join([prefix, self.prefetch_to]) + self.prefetch_through = prefix + LOOKUP_SEP + self.prefetch_through + self.prefetch_to = prefix + LOOKUP_SEP + self.prefetch_to def get_current_prefetch_to(self, level): return LOOKUP_SEP.join(self.prefetch_to.split(LOOKUP_SEP)[:level + 1]) diff --git a/django/forms/formsets.py b/django/forms/formsets.py index 0df122c5bcd..49febc2b2e7 100644 --- a/django/forms/formsets.py +++ b/django/forms/formsets.py @@ -399,17 +399,17 @@ class BaseFormSet: # probably should be. It might make sense to render each form as a # table row with each field as a td. forms = ' '.join(form.as_table() for form in self) - return mark_safe('\n'.join([str(self.management_form), forms])) + return mark_safe(str(self.management_form) + '\n' + forms) def as_p(self): "Return this formset rendered as HTML
s." forms = ' '.join(form.as_p() for form in self) - return mark_safe('\n'.join([str(self.management_form), forms])) + return mark_safe(str(self.management_form) + '\n' + forms) def as_ul(self): "Return this formset rendered as HTML