Merge branch 'master' into all-dj

This commit is contained in:
Bojan Mihelac 2018-11-05 09:03:19 +01:00 committed by GitHub
commit eef0922e39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 19 additions and 37 deletions

View File

@ -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

View File

@ -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.

View File

@ -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/

View File

@ -28,7 +28,7 @@ Widgets
.. autoclass:: import_export.widgets.DurationWidget
:members:
.. autoclass:: import_export.widgets.JSONWidget
:members:

View File

@ -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)

View File

@ -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

View File

@ -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'

View File

@ -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'])

View File

@ -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

View File

@ -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',

View File

@ -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__

View File

@ -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)

View File

@ -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):

View File

@ -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()

View File

@ -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

Binary file not shown.

View File

@ -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