Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1861 from milmazz/E251

Fixed flake8 E251 violations
  • Loading branch information...
commit 91078f566904e49fbf99ec6375ba627e821f6143 2 parents 08e2ece + cbc7cbb
@alex alex authored
Showing with 194 additions and 194 deletions.
  1. +2 −2 django/contrib/admin/templatetags/admin_list.py
  2. +3 −3 django/contrib/comments/feeds.py
  3. +15 −15 django/contrib/comments/forms.py
  4. +12 −12 django/contrib/comments/templatetags/comments.py
  5. +30 −30 django/contrib/comments/views/moderation.py
  6. +17 −17 django/contrib/contenttypes/generic.py
  7. +3 −3 django/contrib/contenttypes/models.py
  8. +3 −3 django/contrib/contenttypes/tests.py
  9. +4 −4 django/contrib/flatpages/forms.py
  10. +1 −1  django/contrib/flatpages/tests/test_middleware.py
  11. +1 −1  django/contrib/flatpages/tests/test_views.py
  12. +5 −5 django/contrib/messages/tests/base.py
  13. +29 −29 django/contrib/syndication/views.py
  14. +1 −1  django/core/files/move.py
  15. +7 −7 django/core/files/uploadhandler.py
  16. +1 −1  django/core/management/commands/makemessages.py
  17. +29 −29 django/db/migrations/autodetector.py
  18. +6 −6 django/db/migrations/state.py
  19. +4 −4 django/db/models/loading.py
  20. +1 −1  django/dispatch/saferef.py
  21. +15 −15 django/forms/forms.py
  22. +1 −1  django/http/multipartparser.py
  23. +1 −1  django/middleware/csrf.py
  24. +3 −3 django/views/generic/base.py
View
4 django/contrib/admin/templatetags/admin_list.py
@@ -96,8 +96,8 @@ def result_headers(cl):
ordering_field_columns = cl.get_ordering_field_columns()
for i, field_name in enumerate(cl.list_display):
text, attr = label_for_field(field_name, cl.model,
- model_admin = cl.model_admin,
- return_attr = True
+ model_admin=cl.model_admin,
+ return_attr=True
)
if attr:
# Potentially not sortable
View
6 django/contrib/comments/feeds.py
@@ -21,9 +21,9 @@ def description(self):
def items(self):
qs = comments.get_model().objects.filter(
- site__pk = self.site.pk,
- is_public = True,
- is_removed = False,
+ site__pk=self.site.pk,
+ is_public=True,
+ is_removed=False,
)
return qs.order_by('-submit_date')[:40]
View
30 django/contrib/comments/forms.py
@@ -132,16 +132,16 @@ def get_comment_create_data(self):
method to add extra fields onto a custom comment model.
"""
return dict(
- content_type = ContentType.objects.get_for_model(self.target_object),
- object_pk = force_text(self.target_object._get_pk_val()),
- user_name = self.cleaned_data["name"],
- user_email = self.cleaned_data["email"],
- user_url = self.cleaned_data["url"],
- comment = self.cleaned_data["comment"],
- submit_date = timezone.now(),
- site_id = settings.SITE_ID,
- is_public = True,
- is_removed = False,
+ content_type=ContentType.objects.get_for_model(self.target_object),
+ object_pk=force_text(self.target_object._get_pk_val()),
+ user_name=self.cleaned_data["name"],
+ user_email=self.cleaned_data["email"],
+ user_url=self.cleaned_data["url"],
+ comment=self.cleaned_data["comment"],
+ submit_date=timezone.now(),
+ site_id=settings.SITE_ID,
+ is_public=True,
+ is_removed=False,
)
def check_for_duplicate_comment(self, new):
@@ -152,11 +152,11 @@ def check_for_duplicate_comment(self, new):
possible_duplicates = self.get_comment_model()._default_manager.using(
self.target_object._state.db
).filter(
- content_type = new.content_type,
- object_pk = new.object_pk,
- user_name = new.user_name,
- user_email = new.user_email,
- user_url = new.user_url,
+ content_type=new.content_type,
+ object_pk=new.object_pk,
+ user_name=new.user_name,
+ user_email=new.user_email,
+ user_url=new.user_url,
)
for old in possible_duplicates:
if old.submit_date.date() == new.submit_date.date() and old.comment == new.comment:
View
24 django/contrib/comments/templatetags/comments.py
@@ -35,8 +35,8 @@ def handle_token(cls, parser, token):
if tokens[3] != 'as':
raise template.TemplateSyntaxError("Third argument in %r must be 'as'" % tokens[0])
return cls(
- object_expr = parser.compile_filter(tokens[2]),
- as_varname = tokens[4],
+ object_expr=parser.compile_filter(tokens[2]),
+ as_varname=tokens[4],
)
# {% get_whatever for app.model pk as varname %}
@@ -44,9 +44,9 @@ def handle_token(cls, parser, token):
if tokens[4] != 'as':
raise template.TemplateSyntaxError("Fourth argument in %r must be 'as'" % tokens[0])
return cls(
- ctype = BaseCommentNode.lookup_content_type(tokens[2], tokens[0]),
- object_pk_expr = parser.compile_filter(tokens[3]),
- as_varname = tokens[5]
+ ctype=BaseCommentNode.lookup_content_type(tokens[2], tokens[0]),
+ object_pk_expr=parser.compile_filter(tokens[3]),
+ as_varname=tokens[5]
)
else:
@@ -83,9 +83,9 @@ def get_queryset(self, context):
return self.comment_model.objects.none()
qs = self.comment_model.objects.filter(
- content_type = ctype,
- object_pk = smart_text(object_pk),
- site__pk = settings.SITE_ID,
+ content_type=ctype,
+ object_pk=smart_text(object_pk),
+ site__pk=settings.SITE_ID,
)
# The is_public and is_removed fields are implementation details of the
@@ -166,8 +166,8 @@ def handle_token(cls, parser, token):
# {% render_comment_form for app.models pk %}
elif len(tokens) == 4:
return cls(
- ctype = BaseCommentNode.lookup_content_type(tokens[2], tokens[0]),
- object_pk_expr = parser.compile_filter(tokens[3])
+ ctype=BaseCommentNode.lookup_content_type(tokens[2], tokens[0]),
+ object_pk_expr=parser.compile_filter(tokens[3])
)
def render(self, context):
@@ -202,8 +202,8 @@ def handle_token(cls, parser, token):
# {% render_comment_list for app.models pk %}
elif len(tokens) == 4:
return cls(
- ctype = BaseCommentNode.lookup_content_type(tokens[2], tokens[0]),
- object_pk_expr = parser.compile_filter(tokens[3])
+ ctype=BaseCommentNode.lookup_content_type(tokens[2], tokens[0]),
+ object_pk_expr=parser.compile_filter(tokens[3])
)
def render(self, context):
View
60 django/contrib/comments/views/moderation.py
@@ -99,40 +99,40 @@ def perform_flag(request, comment):
Actually perform the flagging of a comment from a request.
"""
flag, created = comments.models.CommentFlag.objects.get_or_create(
- comment = comment,
- user = request.user,
- flag = comments.models.CommentFlag.SUGGEST_REMOVAL
+ comment=comment,
+ user=request.user,
+ flag=comments.models.CommentFlag.SUGGEST_REMOVAL
)
signals.comment_was_flagged.send(
- sender = comment.__class__,
- comment = comment,
- flag = flag,
- created = created,
- request = request,
+ sender=comment.__class__,
+ comment=comment,
+ flag=flag,
+ created=created,
+ request=request,
)
def perform_delete(request, comment):
flag, created = comments.models.CommentFlag.objects.get_or_create(
- comment = comment,
- user = request.user,
- flag = comments.models.CommentFlag.MODERATOR_DELETION
+ comment=comment,
+ user=request.user,
+ flag=comments.models.CommentFlag.MODERATOR_DELETION
)
comment.is_removed = True
comment.save()
signals.comment_was_flagged.send(
- sender = comment.__class__,
- comment = comment,
- flag = flag,
- created = created,
- request = request,
+ sender=comment.__class__,
+ comment=comment,
+ flag=flag,
+ created=created,
+ request=request,
)
def perform_approve(request, comment):
flag, created = comments.models.CommentFlag.objects.get_or_create(
- comment = comment,
- user = request.user,
- flag = comments.models.CommentFlag.MODERATOR_APPROVAL,
+ comment=comment,
+ user=request.user,
+ flag=comments.models.CommentFlag.MODERATOR_APPROVAL,
)
comment.is_removed = False
@@ -140,24 +140,24 @@ def perform_approve(request, comment):
comment.save()
signals.comment_was_flagged.send(
- sender = comment.__class__,
- comment = comment,
- flag = flag,
- created = created,
- request = request,
+ sender=comment.__class__,
+ comment=comment,
+ flag=flag,
+ created=created,
+ request=request,
)
# Confirmation views.
flag_done = confirmation_view(
- template = "comments/flagged.html",
- doc = 'Displays a "comment was flagged" success page.'
+ template="comments/flagged.html",
+ doc='Displays a "comment was flagged" success page.'
)
delete_done = confirmation_view(
- template = "comments/deleted.html",
- doc = 'Displays a "comment was deleted" success page.'
+ template="comments/deleted.html",
+ doc='Displays a "comment was deleted" success page.'
)
approve_done = confirmation_view(
- template = "comments/approved.html",
- doc = 'Displays a "comment was approved" success page.'
+ template="comments/approved.html",
+ doc='Displays a "comment was approved" success page.'
)
View
34 django/contrib/contenttypes/generic.py
@@ -276,14 +276,14 @@ def __get__(self, instance, instance_type=None):
join_cols = self.field.get_joining_columns(reverse_join=True)[0]
manager = RelatedManager(
- model = rel_model,
- instance = instance,
- source_col_name = qn(join_cols[0]),
- target_col_name = qn(join_cols[1]),
- content_type = content_type,
- content_type_field_name = self.field.content_type_field_name,
- object_id_field_name = self.field.object_id_field_name,
- prefetch_cache_name = self.field.attname,
+ model=rel_model,
+ instance=instance,
+ source_col_name=qn(join_cols[0]),
+ target_col_name=qn(join_cols[1]),
+ content_type=content_type,
+ content_type_field_name=self.field.content_type_field_name,
+ object_id_field_name=self.field.object_id_field_name,
+ prefetch_cache_name=self.field.attname,
)
return manager
@@ -329,15 +329,15 @@ def __call__(self, **kwargs):
manager = getattr(self.model, kwargs.pop('manager'))
manager_class = create_generic_related_manager(manager.__class__)
return manager_class(
- model = self.model,
- instance = self.instance,
- symmetrical = self.symmetrical,
- source_col_name = self.source_col_name,
- target_col_name = self.target_col_name,
- content_type = self.content_type,
- content_type_field_name = self.content_type_field_name,
- object_id_field_name = self.object_id_field_name,
- prefetch_cache_name = self.prefetch_cache_name,
+ model=self.model,
+ instance=self.instance,
+ symmetrical=self.symmetrical,
+ source_col_name=self.source_col_name,
+ target_col_name=self.target_col_name,
+ content_type=self.content_type,
+ content_type_field_name=self.content_type_field_name,
+ object_id_field_name=self.object_id_field_name,
+ prefetch_cache_name=self.prefetch_cache_name,
)
do_not_call_in_templates = True
View
6 django/contrib/contenttypes/models.py
@@ -43,9 +43,9 @@ def get_for_model(self, model, for_concrete_model=True):
# needed around opts.verbose_name_raw because name_raw might be a
# django.utils.functional.__proxy__ object.
ct, created = self.get_or_create(
- app_label = opts.app_label,
- model = opts.model_name,
- defaults = {'name': smart_text(opts.verbose_name_raw)},
+ app_label=opts.app_label,
+ model=opts.model_name,
+ defaults={'name': smart_text(opts.verbose_name_raw)},
)
self._add_to_cache(self.db, ct)
View
6 django/contrib/contenttypes/tests.py
@@ -271,9 +271,9 @@ def test_missing_model(self):
is defined anymore.
"""
ct = ContentType.objects.create(
- name = 'Old model',
- app_label = 'contenttypes',
- model = 'OldModel',
+ name='Old model',
+ app_label='contenttypes',
+ model='OldModel',
)
self.assertEqual(six.text_type(ct), 'Old model')
self.assertIsNone(ct.model_class())
View
8 django/contrib/flatpages/forms.py
@@ -6,10 +6,10 @@
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
- help_text = _("Example: '/about/contact/'. Make sure to have leading"
- " and trailing slashes."),
- error_message = _("This value must contain only letters, numbers,"
- " dots, underscores, dashes, slashes or tildes."))
+ help_text=_("Example: '/about/contact/'. Make sure to have leading"
+ " and trailing slashes."),
+ error_message=_("This value must contain only letters, numbers,"
+ " dots, underscores, dashes, slashes or tildes."))
class Meta:
model = FlatPage
View
2  django/contrib/flatpages/tests/test_middleware.py
@@ -87,7 +87,7 @@ def test_fallback_flatpage_special_chars(self):
@override_settings(
- APPEND_SLASH = True,
+ APPEND_SLASH=True,
LOGIN_URL='/accounts/login/',
MIDDLEWARE_CLASSES=(
'django.middleware.common.CommonMiddleware',
View
2  django/contrib/flatpages/tests/test_views.py
@@ -75,7 +75,7 @@ def test_view_flatpage_special_chars(self):
@override_settings(
- APPEND_SLASH = True,
+ APPEND_SLASH=True,
LOGIN_URL='/accounts/login/',
MIDDLEWARE_CLASSES=(
'django.middleware.common.CommonMiddleware',
View
10 django/contrib/messages/tests/base.py
@@ -58,12 +58,12 @@ class BaseTests(object):
def setUp(self):
self.settings_override = override_settings_tags(
- TEMPLATE_DIRS = (),
- TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS,
- MESSAGE_TAGS = '',
- MESSAGE_STORAGE = '%s.%s' % (self.storage_class.__module__,
+ TEMPLATE_DIRS=(),
+ TEMPLATE_CONTEXT_PROCESSORS=global_settings.TEMPLATE_CONTEXT_PROCESSORS,
+ MESSAGE_TAGS='',
+ MESSAGE_STORAGE='%s.%s' % (self.storage_class.__module__,
self.storage_class.__name__),
- SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer',
+ SESSION_SERIALIZER='django.contrib.sessions.serializers.JSONSerializer',
)
self.settings_override.enable()
View
58 django/contrib/syndication/views.py
@@ -121,23 +121,23 @@ def get_feed(self, obj, request):
link = add_domain(current_site.domain, link, request.is_secure())
feed = self.feed_type(
- title = self.__get_dynamic_attr('title', obj),
- subtitle = self.__get_dynamic_attr('subtitle', obj),
- link = link,
- description = self.__get_dynamic_attr('description', obj),
- language = settings.LANGUAGE_CODE,
- feed_url = add_domain(
+ title=self.__get_dynamic_attr('title', obj),
+ subtitle=self.__get_dynamic_attr('subtitle', obj),
+ link=link,
+ description=self.__get_dynamic_attr('description', obj),
+ language=settings.LANGUAGE_CODE,
+ feed_url=add_domain(
current_site.domain,
self.__get_dynamic_attr('feed_url', obj) or request.path,
request.is_secure(),
),
- author_name = self.__get_dynamic_attr('author_name', obj),
- author_link = self.__get_dynamic_attr('author_link', obj),
- author_email = self.__get_dynamic_attr('author_email', obj),
- categories = self.__get_dynamic_attr('categories', obj),
- feed_copyright = self.__get_dynamic_attr('feed_copyright', obj),
- feed_guid = self.__get_dynamic_attr('feed_guid', obj),
- ttl = self.__get_dynamic_attr('ttl', obj),
+ author_name=self.__get_dynamic_attr('author_name', obj),
+ author_link=self.__get_dynamic_attr('author_link', obj),
+ author_email=self.__get_dynamic_attr('author_email', obj),
+ categories=self.__get_dynamic_attr('categories', obj),
+ feed_copyright=self.__get_dynamic_attr('feed_copyright', obj),
+ feed_guid=self.__get_dynamic_attr('feed_guid', obj),
+ ttl=self.__get_dynamic_attr('ttl', obj),
**self.feed_extra_kwargs(obj)
)
@@ -175,9 +175,9 @@ def get_feed(self, obj, request):
enc_url = self.__get_dynamic_attr('item_enclosure_url', item)
if enc_url:
enc = feedgenerator.Enclosure(
- url = smart_text(enc_url),
- length = smart_text(self.__get_dynamic_attr('item_enclosure_length', item)),
- mime_type = smart_text(self.__get_dynamic_attr('item_enclosure_mime_type', item))
+ url=smart_text(enc_url),
+ length=smart_text(self.__get_dynamic_attr('item_enclosure_length', item)),
+ mime_type=smart_text(self.__get_dynamic_attr('item_enclosure_mime_type', item))
)
author_name = self.__get_dynamic_attr('item_author_name', item)
if author_name is not None:
@@ -197,20 +197,20 @@ def get_feed(self, obj, request):
updateddate = make_aware(updateddate, tz)
feed.add_item(
- title = title,
- link = link,
- description = description,
- unique_id = self.__get_dynamic_attr('item_guid', item, link),
- unique_id_is_permalink = self.__get_dynamic_attr(
+ title=title,
+ link=link,
+ description=description,
+ unique_id=self.__get_dynamic_attr('item_guid', item, link),
+ unique_id_is_permalink=self.__get_dynamic_attr(
'item_guid_is_permalink', item),
- enclosure = enc,
- pubdate = pubdate,
- updateddate = updateddate,
- author_name = author_name,
- author_email = author_email,
- author_link = author_link,
- categories = self.__get_dynamic_attr('item_categories', item),
- item_copyright = self.__get_dynamic_attr('item_copyright', item),
+ enclosure=enc,
+ pubdate=pubdate,
+ updateddate=updateddate,
+ author_name=author_name,
+ author_email=author_email,
+ author_link=author_link,
+ categories=self.__get_dynamic_attr('item_categories', item),
+ item_copyright=self.__get_dynamic_attr('item_copyright', item),
**self.item_extra_kwargs(item)
)
return feed
View
2  django/core/files/move.py
@@ -38,7 +38,7 @@ def _samefile(src, dst):
os.path.normcase(os.path.abspath(dst)))
-def file_move_safe(old_file_name, new_file_name, chunk_size = 1024*64, allow_overwrite=False):
+def file_move_safe(old_file_name, new_file_name, chunk_size=1024*64, allow_overwrite=False):
"""
Moves a file from one location to another in the safest way possible.
View
14 django/core/files/uploadhandler.py
@@ -193,13 +193,13 @@ def file_complete(self, file_size):
self.file.seek(0)
return InMemoryUploadedFile(
- file = self.file,
- field_name = self.field_name,
- name = self.file_name,
- content_type = self.content_type,
- size = file_size,
- charset = self.charset,
- content_type_extra = self.content_type_extra
+ file=self.file,
+ field_name=self.field_name,
+ name=self.file_name,
+ content_type=self.content_type,
+ size=file_size,
+ charset=self.charset,
+ content_type_extra=self.content_type_extra
)
View
2  django/core/management/commands/makemessages.py
@@ -239,7 +239,7 @@ def handle_noargs(self, *args, **options):
if settings.configured:
settings.USE_I18N = True
else:
- settings.configure(USE_I18N = True)
+ settings.configure(USE_I18N=True)
self.invoked_for_django = False
if os.path.isdir(os.path.join('conf', 'locale')):
View
58 django/db/migrations/autodetector.py
@@ -81,10 +81,10 @@ def _detect_changes(self):
self.add_to_migration(
app_label,
operations.CreateModel(
- name = model_state.name,
- fields = model_state.fields,
- options = model_state.options,
- bases = model_state.bases,
+ name=model_state.name,
+ fields=model_state.fields,
+ options=model_state.options,
+ bases=model_state.bases,
)
)
# Phase 2 is progressively adding pending models, splitting up into two
@@ -99,10 +99,10 @@ def _detect_changes(self):
self.add_to_migration(
app_label,
operations.CreateModel(
- name = model_state.name,
- fields = model_state.fields,
- options = model_state.options,
- bases = model_state.bases,
+ name=model_state.name,
+ fields=model_state.fields,
+ options=model_state.options,
+ bases=model_state.bases,
)
)
for field_name, other_app_label, other_model_name in related_fields:
@@ -119,10 +119,10 @@ def _detect_changes(self):
self.add_to_migration(
app_label,
operations.CreateModel(
- name = model_state.name,
- fields = [(n, f) for n, f in model_state.fields if n not in bad_fields],
- options = model_state.options,
- bases = model_state.bases,
+ name=model_state.name,
+ fields=[(n, f) for n, f in model_state.fields if n not in bad_fields],
+ options=model_state.options,
+ bases=model_state.bases,
)
)
# Add the bad fields to be made in a phase 3
@@ -135,11 +135,11 @@ def _detect_changes(self):
self.add_to_migration(
app_label,
operations.AddField(
- model_name = model_name,
- name = field_name,
- field = model_state.get_field_by_name(field_name),
+ model_name=model_name,
+ name=field_name,
+ field=model_state.get_field_by_name(field_name),
),
- new = True,
+ new=True,
)
if app_label != other_app_label:
self.add_dependency(app_label, other_app_label)
@@ -172,9 +172,9 @@ def _detect_changes(self):
self.add_to_migration(
app_label,
operations.RenameField(
- model_name = model_name,
- old_name = removed_field_name,
- new_name = field_name,
+ model_name=model_name,
+ old_name=removed_field_name,
+ new_name=field_name,
)
)
old_field_names.remove(removed_field_name)
@@ -189,9 +189,9 @@ def _detect_changes(self):
self.add_to_migration(
app_label,
operations.AddField(
- model_name = model_name,
- name = field_name,
- field = field,
+ model_name=model_name,
+ name=field_name,
+ field=field,
)
)
# Old fields
@@ -199,8 +199,8 @@ def _detect_changes(self):
self.add_to_migration(
app_label,
operations.RemoveField(
- model_name = model_name,
- name = field_name,
+ model_name=model_name,
+ name=field_name,
)
)
# The same fields
@@ -212,9 +212,9 @@ def _detect_changes(self):
self.add_to_migration(
app_label,
operations.AlterField(
- model_name = model_name,
- name = field_name,
- field = new_model_state.get_field_by_name(field_name),
+ model_name=model_name,
+ name=field_name,
+ field=new_model_state.get_field_by_name(field_name),
)
)
# unique_together changes
@@ -222,8 +222,8 @@ def _detect_changes(self):
self.add_to_migration(
app_label,
operations.AlterUniqueTogether(
- name = model_name,
- unique_together = new_model_state.options.get("unique_together", set()),
+ name=model_name,
+ unique_together=new_model_state.options.get("unique_together", set()),
)
)
# Alright, now add internal dependencies
View
12 django/db/migrations/state.py
@@ -26,7 +26,7 @@ def add_model_state(self, model_state):
def clone(self):
"Returns an exact copy of this ProjectState"
return ProjectState(
- models = dict((k, v.clone()) for k, v in self.models.items())
+ models=dict((k, v.clone()) for k, v in self.models.items())
)
def render(self):
@@ -137,11 +137,11 @@ def clone(self):
fields.append((name, field_class(*args, **kwargs)))
# Now make a copy
return self.__class__(
- app_label = self.app_label,
- name = self.name,
- fields = fields,
- options = dict(self.options),
- bases = self.bases,
+ app_label=self.app_label,
+ name=self.name,
+ fields=fields,
+ options=dict(self.options),
+ bases=self.bases,
)
def render(self, app_cache):
View
8 django/db/models/loading.py
@@ -43,20 +43,20 @@ def _initialize():
app_store=ModelDict(),
# Mapping of installed app_labels to model modules for that app.
- app_labels = {},
+ app_labels={},
# Mapping of app_labels to a dictionary of model names to model code.
# May contain apps that are not installed.
app_models=ModelDict(),
# Mapping of app_labels to errors raised when trying to import the app.
- app_errors = {},
+ app_errors={},
# Pending lookups for lazy relations
- pending_lookups = {},
+ pending_lookups={},
# -- Everything below here is only used when populating the cache --
- loads_installed = True,
+ loads_installed=True,
loaded=False,
handled=set(),
postponed=[],
View
2  django/dispatch/saferef.py
@@ -9,7 +9,7 @@
import weakref
-def safeRef(target, onDelete = None):
+def safeRef(target, onDelete=None):
"""Return a *safe* weak reference to a callable target
target -- the object to be weakly referenced, if it's a
View
30 django/forms/forms.py
@@ -249,29 +249,29 @@ def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_
def as_table(self):
"Returns this form rendered as HTML <tr>s -- excluding the <table></table>."
return self._html_output(
- normal_row = '<tr%(html_class_attr)s><th>%(label)s</th><td>%(errors)s%(field)s%(help_text)s</td></tr>',
- error_row = '<tr><td colspan="2">%s</td></tr>',
- row_ender = '</td></tr>',
- help_text_html = '<br /><span class="helptext">%s</span>',
- errors_on_separate_row = False)
+ normal_row='<tr%(html_class_attr)s><th>%(label)s</th><td>%(errors)s%(field)s%(help_text)s</td></tr>',
+ error_row='<tr><td colspan="2">%s</td></tr>',
+ row_ender='</td></tr>',
+ help_text_html='<br /><span class="helptext">%s</span>',
+ errors_on_separate_row=False)
def as_ul(self):
"Returns this form rendered as HTML <li>s -- excluding the <ul></ul>."
return self._html_output(
- normal_row = '<li%(html_class_attr)s>%(errors)s%(label)s %(field)s%(help_text)s</li>',
- error_row = '<li>%s</li>',
- row_ender = '</li>',
- help_text_html = ' <span class="helptext">%s</span>',
- errors_on_separate_row = False)
+ normal_row='<li%(html_class_attr)s>%(errors)s%(label)s %(field)s%(help_text)s</li>',
+ error_row='<li>%s</li>',
+ row_ender='</li>',
+ help_text_html=' <span class="helptext">%s</span>',
+ errors_on_separate_row=False)
def as_p(self):
"Returns this form rendered as HTML <p>s."
return self._html_output(
- normal_row = '<p%(html_class_attr)s>%(label)s %(field)s%(help_text)s</p>',
- error_row = '%s',
- row_ender = '</p>',
- help_text_html = ' <span class="helptext">%s</span>',
- errors_on_separate_row = True)
+ normal_row='<p%(html_class_attr)s>%(label)s %(field)s%(help_text)s</p>',
+ error_row='%s',
+ row_ender='</p>',
+ help_text_html=' <span class="helptext">%s</span>',
+ errors_on_separate_row=True)
def non_field_errors(self):
"""
View
2  django/http/multipartparser.py
@@ -495,7 +495,7 @@ def __next__(self):
stream.unget(chunk[-rollback:])
return chunk[:-rollback]
- def _find_boundary(self, data, eof = False):
+ def _find_boundary(self, data, eof=False):
"""
Finds a multipart boundary in data.
View
2  django/middleware/csrf.py
@@ -196,7 +196,7 @@ def process_response(self, request, response):
# the expiry timer.
response.set_cookie(settings.CSRF_COOKIE_NAME,
request.META["CSRF_COOKIE"],
- max_age = 60 * 60 * 24 * 7 * 52,
+ max_age=60 * 60 * 24 * 7 * 52,
domain=settings.CSRF_COOKIE_DOMAIN,
path=settings.CSRF_COOKIE_PATH,
secure=settings.CSRF_COOKIE_SECURE,
View
6 django/views/generic/base.py
@@ -126,9 +126,9 @@ def render_to_response(self, context, **response_kwargs):
"""
response_kwargs.setdefault('content_type', self.content_type)
return self.response_class(
- request = self.request,
- template = self.get_template_names(),
- context = context,
+ request=self.request,
+ template=self.get_template_names(),
+ context=context,
**response_kwargs
)
Please sign in to comment.
Something went wrong with that request. Please try again.