diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index d1ebd1d..9420974 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -71,4 +71,3 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org - diff --git a/LICENSE b/LICENSE index b49930c..c8b4a8a 100644 --- a/LICENSE +++ b/LICENSE @@ -4,10 +4,10 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. diff --git a/README.rst b/README.rst index f0697dc..ec1f3da 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ django-import-export :alt: Current version on PyPi .. image:: http://readthedocs.org/projects/django-import-export/badge/?version=stable - :target: http://django-import-export.readthedocs.io/en/stable/ + :target: https://django-import-export.readthedocs.io/en/stable/ :alt: Documentation django-import-export is a Django application and library for importing @@ -36,7 +36,7 @@ Features: .. image:: docs/_static/images/django-import-export-change.png -* Documentation: http://django-import-export.readthedocs.io/en/stable/ +* Documentation: https://django-import-export.readthedocs.io/en/stable/ * GitHub: https://github.com/django-import-export/django-import-export/ * Free software: BSD license * PyPI: https://pypi.org/project/django-import-export/ diff --git a/docs/api_widgets.rst b/docs/api_widgets.rst index f956ca3..94b69a5 100644 --- a/docs/api_widgets.rst +++ b/docs/api_widgets.rst @@ -28,7 +28,7 @@ Widgets .. autoclass:: import_export.widgets.DurationWidget :members: - + .. autoclass:: import_export.widgets.JSONWidget :members: diff --git a/docs/changelog.rst b/docs/changelog.rst index 7b7568f..012e83c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -17,7 +17,7 @@ Changelog - JSONWidget for jsonb fields (#803) -- Add ExportActionMixin (#809) +- Add ExportActionMixin (#809) - Add Import Export Permissioning #608 (#804) @@ -166,7 +166,7 @@ Changelog - Append rows to Result object via function call to allow overriding (#462) -- Add get_resource_kwargs to allow passing request to resource (#457) +- Add get_resource_kwargs to allow passing request to resource (#457) - Expose Django user to get_export_data() and export() (#447) diff --git a/import_export/admin.py b/import_export/admin.py index 7f8409a..a3bfbc2 100644 --- a/import_export/admin.py +++ b/import_export/admin.py @@ -20,7 +20,6 @@ try: except ImportError: # Django<2.0 from django.core.urlresolvers import reverse from django.conf import settings -from django.template.defaultfilters import pluralize from django.utils.decorators import method_decorator from django.utils.encoding import force_text from django.views.decorators.http import require_POST diff --git a/import_export/formats/base_formats.py b/import_export/formats/base_formats.py index 7933760..57b5cb2 100644 --- a/import_export/formats/base_formats.py +++ b/import_export/formats/base_formats.py @@ -77,7 +77,7 @@ class Format(object): def get_content_type(self): # For content types see - # http://www.iana.org/assignments/media-types/media-types.xhtml + # https://www.iana.org/assignments/media-types/media-types.xhtml return 'application/octet-stream' def can_import(self): @@ -156,7 +156,7 @@ class JSON(TextFormat): class YAML(TextFormat): TABLIB_MODULE = 'tablib.formats._yaml' - # See http://stackoverflow.com/questions/332129/yaml-mime-type + # See https://stackoverflow.com/questions/332129/yaml-mime-type CONTENT_TYPE = 'text/yaml' diff --git a/import_export/mixins.py b/import_export/mixins.py index 5e44c19..abf3a32 100644 --- a/import_export/mixins.py +++ b/import_export/mixins.py @@ -64,7 +64,7 @@ class ExportViewMixin(object): class ExportViewFormMixin(ExportViewMixin, FormView): - def form_valid(self, form): + def form_valid(self, form): formats = self.get_export_formats() file_format = formats[ int(form.cleaned_data['file_format']) diff --git a/import_export/resources.py b/import_export/resources.py index 3d04b9c..152222b 100644 --- a/import_export/resources.py +++ b/import_export/resources.py @@ -9,7 +9,6 @@ from copy import deepcopy from diff_match_patch import diff_match_patch -from django import VERSION from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.color import no_style diff --git a/import_export/widgets.py b/import_export/widgets.py index 67b1fe1..6f4ccda 100644 --- a/import_export/widgets.py +++ b/import_export/widgets.py @@ -264,7 +264,7 @@ class SimpleArrayWidget(Widget): def render(self, value, obj=None): return self.separator.join(six.text_type(v) for v in value) - + class JSONWidget(Widget): """ Widget for a JSON object (especially required for jsonb fields in PostgreSQL database.) @@ -305,7 +305,7 @@ class ForeignKeyWidget(Widget): from import_export import fields, resources from import_export.widgets import ForeignKeyWidget - + class BookResource(resources.ModelResource): author = fields.Field( column_name='author', diff --git a/setup.py b/setup.py index 23864d3..fc85b82 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ -from distutils.core import setup -from setuptools import find_packages +from setuptools import find_packages, setup VERSION = __import__("import_export").__version__ diff --git a/tests/core/tests/test_admin_integration.py b/tests/core/tests/test_admin_integration.py index 403e1b9..f34a4cb 100644 --- a/tests/core/tests/test_admin_integration.py +++ b/tests/core/tests/test_admin_integration.py @@ -64,7 +64,7 @@ class ImportExportAdminIntegrationTest(TestCase): response = self.client.post('/admin/core/book/process_import/', data, follow=True) self.assertEqual(response.status_code, 200) - self.assertContains(response, + self.assertContains(response, _('Import finished, with {} new and {} updated {}.').format( 1, 0, Book._meta.verbose_name_plural) ) @@ -101,7 +101,7 @@ class ImportExportAdminIntegrationTest(TestCase): response = self.client.post('/admin/core/book/process_import/', data, follow=True) self.assertEqual(response.status_code, 200) - self.assertContains(response, + self.assertContains(response, _('Import finished, with {} new and {} updated {}.').format( 1, 0, Book._meta.verbose_name_plural) ) @@ -207,7 +207,7 @@ class ImportExportAdminIntegrationTest(TestCase): self.assertEqual(child.object_id, str(1)) def test_logentry_creation_with_import_obj_exception(self): - # from http://mail.python.org/pipermail/python-dev/2008-January/076194.html + # from https://mail.python.org/pipermail/python-dev/2008-January/076194.html def monkeypatch_method(cls): def decorator(func): setattr(cls, func.__name__, func) diff --git a/tests/core/tests/test_permissions.py b/tests/core/tests/test_permissions.py index f366c71..ce30bb5 100644 --- a/tests/core/tests/test_permissions.py +++ b/tests/core/tests/test_permissions.py @@ -2,18 +2,10 @@ from __future__ import unicode_literals import os.path -from django.contrib.auth import get_permission_codename from django.contrib.auth.models import Permission from django.test.utils import override_settings from django.test.testcases import TestCase from django.contrib.auth.models import User -from django.core.files.uploadedfile import SimpleUploadedFile -from django.utils.translation import ugettext_lazy as _ -from django.contrib.admin.models import LogEntry -from tablib import Dataset - -from core.admin import BookAdmin, AuthorAdmin, BookResource -from core.models import Category, Parent, Book class ImportExportPermissionTest(TestCase): diff --git a/tests/core/tests/test_resources.py b/tests/core/tests/test_resources.py index 85838d9..9b0e342 100644 --- a/tests/core/tests/test_resources.py +++ b/tests/core/tests/test_resources.py @@ -1,12 +1,12 @@ from __future__ import unicode_literals import tablib +from collections import OrderedDict from copy import deepcopy from datetime import date from decimal import Decimal from unittest import skip, skipUnless -from django import VERSION from django.conf import settings from django.contrib.auth.models import User from django.db import IntegrityError, DatabaseError @@ -25,11 +25,6 @@ from ..models import ( WithFloatField, Person, Role ) -try: - from collections import OrderedDict -except ImportError: - from django.utils.datastructures import SortedDict as OrderedDict - class MyResource(resources.Resource): name = fields.Field() diff --git a/tests/core/tests/test_widgets.py b/tests/core/tests/test_widgets.py index 7671692..39af41e 100644 --- a/tests/core/tests/test_widgets.py +++ b/tests/core/tests/test_widgets.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals from decimal import Decimal from datetime import date, datetime, time, timedelta -from unittest import SkipTest from django.test.utils import override_settings from django.test import TestCase diff --git a/tests/database.db b/tests/database.db index 73a7485..a252d0b 100644 Binary files a/tests/database.db and b/tests/database.db differ diff --git a/tests/urls.py b/tests/urls.py index 9a7f076..57c8709 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from django.conf.urls import url, include +from django.conf.urls import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin