Skip to content

Commit 8ed3ad2

Browse files
committed
PEP-8
1 parent 0e1aa63 commit 8ed3ad2

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

tabular_export/admin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def ensure_filename(suffix):
2626
from the ``ModelAdmin.model``'s ``verbose_name_plural`` value unless a value
2727
was provided by the caller.
2828
"""
29+
2930
def outer(f):
3031
# TODO: After upgrading to Python 3, we can drop the extra args using , *, to force keyword-only args
3132
@wraps(f)
@@ -42,6 +43,8 @@ def export_to_excel_action(modeladmin, request, queryset, filename=None, field_n
4243
"""Django admin action which exports selected records as an Excel XLSX download"""
4344
headers, rows = flatten_queryset(queryset, field_names=field_names)
4445
return export_to_excel_response(filename, headers, rows)
46+
47+
4548
export_to_excel_action.short_description = _('Export to Excel')
4649

4750

@@ -50,4 +53,6 @@ def export_to_csv_action(modeladmin, request, queryset, filename=None, field_nam
5053
"""Django admin action which exports the selected records as a CSV download"""
5154
headers, rows = flatten_queryset(queryset, field_names=field_names)
5255
return export_to_csv_response(filename, headers, rows)
56+
57+
5358
export_to_csv_action.short_description = _('Export to CSV')

tests/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ def tags_count(self, obj):
2323
def get_queryset(self, *args, **kwargs):
2424
return self.model.objects.all().annotate(tags_count=Count('tags', distinct=True))
2525

26+
2627
admin.site.register(TestModel, TestModelAdmin)

tests/test_tabular_exporter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
from django.test.utils import override_settings
1313

1414
from tabular_export.admin import ensure_filename
15-
from tabular_export.core import (convert_value_to_unicode, export_to_csv_response, export_to_debug_html_response,
16-
export_to_excel_response, flatten_queryset, get_field_names_from_queryset,
17-
set_content_disposition)
15+
from tabular_export.core import (convert_value_to_unicode, export_to_csv_response,
16+
export_to_debug_html_response, export_to_excel_response, flatten_queryset,
17+
get_field_names_from_queryset, set_content_disposition)
1818

1919
from .models import TestModel
2020

2121

2222
def assert_is_valid_xlsx(bytestream, required_filename='xl/worksheets/sheet1.xml'):
23-
# We'll confirm that it's returning a valid zip file but will trust the Excel library's tests for
24-
# the actual content:
23+
# We'll confirm that it's returning a valid zip file but will trust the
24+
# Excel library's tests for the actual content:
2525

2626
zf = zipfile.ZipFile(BytesIO(bytestream))
2727
zf.testzip()

0 commit comments

Comments
 (0)