Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Django 3.1 support #1201

Merged
merged 28 commits into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
467b2de
lift the setup.py restrictions
FinalAngel Jan 9, 2020
69cc516
update files
FinalAngel Jan 16, 2020
919530e
fix isort
FinalAngel Jan 16, 2020
a9ac15b
add further fixes
FinalAngel Jan 16, 2020
3b9571f
update app helper
FinalAngel Jan 16, 2020
ec487c3
Merge branch 'master' into feature/django-3.x
FinalAngel Jan 16, 2020
564bd5a
fix docs
FinalAngel Jan 16, 2020
68b6417
fix last issues
FinalAngel Jan 16, 2020
33bd163
update docs :)
FinalAngel Jan 16, 2020
ac1c503
Remove Python-2 legacy (#1178)
jrief Aug 13, 2020
470aaa5
Merge branch 'master' into feature/django-3.x
FinalAngel Aug 13, 2020
9ee3c89
Merge branch 'feature/django-3.x' of github.com:divio/django-filer in…
FinalAngel Aug 13, 2020
39621f5
further adaptions
FinalAngel Aug 13, 2020
889f283
additional fixes fom comments
FinalAngel Aug 14, 2020
5031be5
fix tests
FinalAngel Aug 14, 2020
12a05b9
fix isort
FinalAngel Aug 14, 2020
8ec7e6d
I give up on the integration tests
FinalAngel Aug 14, 2020
8d1f71e
well fe tests can still be enabled :)
FinalAngel Aug 14, 2020
3505937
move the comma to the comment
FinalAngel Aug 14, 2020
8dc803e
add depth again
FinalAngel Aug 17, 2020
fc2788b
fix 3.1 issue
FinalAngel Aug 17, 2020
2a08560
fix windowname_to_id
FinalAngel Aug 17, 2020
c1c5eb8
updates
FinalAngel Aug 18, 2020
2c26a2a
compare in lowercase for certain dbs
FinalAngel Aug 18, 2020
e089f94
fixes docs?
FinalAngel Aug 18, 2020
ef3a6e7
update polymorphic version
FinalAngel Aug 21, 2020
cd05f79
update docs
FinalAngel Aug 21, 2020
83ad5ea
rename license file
FinalAngel Aug 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python

dist: xenial
sudo: false

matrix:
include:
Expand All @@ -13,29 +12,33 @@ matrix:
env: TOX_ENV='docs'
- python: 3.6
env: TOX_ENV='frontend'
# Django 1.11
- python: 3.4
env: DJANGO='dj111' SWAP='noswap'
# Django 2.2
- python: 3.5
env: DJANGO='dj111' SWAP='noswap'
- python: 3.6
env: DJANGO='dj111' SWAP='noswap'
env: DJANGO='dj22' SWAP='swap'
- python: 3.6
env: DJANGO='dj111' SWAP='swap'
# Django 2.2
- python: 3.7
env: DJANGO='dj22' SWAP='noswap'
- python: 3.8
env: DJANGO='dj22' SWAP='swap'
# Django 3.0
- python: 3.7
env: DJANGO='dj30' SWAP='noswap'
env: DJANGO='dj22' SWAP='swap'
- python: 3.8
env: DJANGO='dj22' SWAP='noswap'
# Django 3.0, always run the lowest supported version
- python: 3.6
env: DJANGO='dj30' SWAP='swap'
- python: 3.6
env: DJANGO='dj30' SWAP='noswap'
# Django 3.1, always run the lowest supported version
- python: 3.6
env: DJANGO='dj31' SWAP='swap'
- python: 3.6
env: DJANGO='dj31' SWAP='noswap'
allow_failures:
- python: 3.6
env: DJANGO='dj31' SWAP='swap'
- python: 3.6
env: DJANGO='dj31' SWAP='noswap'

install:
- pip install coverage isort tox
- "if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then export PY_VER=py34; fi"
- "if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then export PY_VER=py35; fi"
- "if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then export PY_VER=py36; fi"
- "if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then export PY_VER=py37; fi"
Expand All @@ -44,6 +47,7 @@ install:

before_script:
- if [ $TOX_ENV == 'frontend' ]; then
pip install -r tests/requirements/frontend.txt;
nvm install 0.12.7 && nvm use 0.12.7;
npm config set spin false;
npm install -g npm@2;
Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
CHANGELOG
=========

Next Version
============

2.0.0 (unreleased)
==================

* Added support for Django 3.1
* Dropped support for Python 2.7 and Python 3.4
* Dropped support for Django < 2.2
* Changed the preferred way to do model registration via model inheritance
and ``mptt.AlreadyRegistered``, which is deprecated since django-mptt 0.4

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include LICENSE.txt
include LICENSE
include README.rst
recursive-include filer/locale *
recursive-include filer/static *
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ for all the details on how to install, configure and use django-filer.
.. |coverage| image:: https://codecov.io/gh/divio/django-filer/branch/master/graph/badge.svg
:target: https://codecov.io/gh/divio/django-filer

.. |python| image:: https://img.shields.io/badge/python-2.7%20%7C%203.4+-blue.svg
.. |python| image:: https://img.shields.io/badge/python-3.5+-blue.svg
:target: https://pypi.org/project/django-filer/
.. |django| image:: https://img.shields.io/badge/django-1.11%20%7C%202.1%20%7C%202.2-blue.svg
.. |django| image:: https://img.shields.io/badge/django-2.2,%203.0,%203.1-blue.svg
:target: https://www.djangoproject.com/
1 change: 0 additions & 1 deletion aldryn_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from aldryn_client import forms


Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# django-filer documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 16 22:05:55 2010.
Expand All @@ -11,12 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
sys.path.append(os.path.abspath('../'))
import datetime
import os
import sys

from filer import __version__
sys.path.append(os.path.abspath('../'))
yakky marked this conversation as resolved.
Show resolved Hide resolved

from filer import __version__

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
6 changes: 3 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The easiest way to get ``django-filer`` is simply install it with `pip`_::
Dependencies
------------

* `Django`_ >= 1.11
* `Django`_ >= 2.2
* `django-mptt`_ >=0.6
* `easy_thumbnails`_ >= 2.0
* `django-polymorphic`_ >= 0.7
Expand All @@ -28,9 +28,9 @@ check `Pillow doc`_.

`django-polymorphic`_ version depends on `Django`_ version:

* for `Django`_ >=1.8,<1.11 use `django-polymorphic`_ 1.3.1
* for `Django`_ >=1.11 use `django-polymorphic`_ >=2.0
* for `Django`_ >=2.2 use `django-polymorphic`_ >=2.0
* for `Django`_ >=3.0 use `django-polymorphic`_ >=2.1
yakky marked this conversation as resolved.
Show resolved Hide resolved
* for `Django`_ >=3.1 use `django-polymorphic`_ >=3.0

Configuration
-------------
Expand Down
1 change: 0 additions & 1 deletion filer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
See PEP 386 (https://www.python.org/dev/peps/pep-0386/)

Expand Down
1 change: 0 additions & 1 deletion filer/admin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.contrib import admin

from ..models import Clipboard, File, Folder, FolderPermission, ThumbnailOption
Expand Down
37 changes: 17 additions & 20 deletions filer/admin/clipboardadmin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import

from django.conf.urls import url
from django.contrib import admin
from django.forms.models import modelform_factory
from django.http import JsonResponse
from django.urls import re_path
from django.views.decorators.csrf import csrf_exempt

from .. import settings as filer_settings
Expand Down Expand Up @@ -40,22 +37,22 @@ class ClipboardAdmin(admin.ModelAdmin):

def get_urls(self):
return [
url(r'^operations/paste_clipboard_to_folder/$',
self.admin_site.admin_view(views.paste_clipboard_to_folder),
name='filer-paste_clipboard_to_folder'),
url(r'^operations/discard_clipboard/$',
self.admin_site.admin_view(views.discard_clipboard),
name='filer-discard_clipboard'),
url(r'^operations/delete_clipboard/$',
self.admin_site.admin_view(views.delete_clipboard),
name='filer-delete_clipboard'),
url(r'^operations/upload/(?P<folder_id>[0-9]+)/$',
ajax_upload,
name='filer-ajax_upload'),
url(r'^operations/upload/no_folder/$',
ajax_upload,
name='filer-ajax_upload'),
] + super(ClipboardAdmin, self).get_urls()
re_path(r'^operations/paste_clipboard_to_folder/$',
self.admin_site.admin_view(views.paste_clipboard_to_folder),
name='filer-paste_clipboard_to_folder'),
re_path(r'^operations/discard_clipboard/$',
self.admin_site.admin_view(views.discard_clipboard),
name='filer-discard_clipboard'),
re_path(r'^operations/delete_clipboard/$',
self.admin_site.admin_view(views.delete_clipboard),
name='filer-delete_clipboard'),
re_path(r'^operations/upload/(?P<folder_id>[0-9]+)/$',
ajax_upload,
name='filer-ajax_upload'),
re_path(r'^operations/upload/no_folder/$',
ajax_upload,
name='filer-ajax_upload'),
] + super().get_urls()

def get_model_perms(self, *args, **kwargs):
"""
Expand Down
15 changes: 6 additions & 9 deletions filer/admin/fileadmin.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import

from django import forms
from django.contrib.admin.utils import unquote
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from .. import settings
from ..models import File
Expand All @@ -15,7 +12,7 @@


class FileAdminChangeFrom(forms.ModelForm):
class Meta(object):
class Meta:
model = File
exclude = ()

Expand Down Expand Up @@ -82,7 +79,7 @@ def response_change(self, request, obj):
admin_url_params_encoded(request),
)
return HttpResponseRedirect(url)
return super(FileAdmin, self).response_change(request, obj)
return super().response_change(request, obj)

def render_change_form(self, request, context, add=False, change=False,
form_url='', obj=None):
Expand All @@ -92,7 +89,7 @@ def render_change_form(self, request, context, add=False, change=False,
'is_popup': popup_status(request),
'filer_admin_context': AdminContext(request)}
context.update(extra_context)
return super(FileAdmin, self).render_change_form(
return super().render_change_form(
request=request, context=context, add=add, change=change,
form_url=form_url, obj=obj)

Expand All @@ -113,7 +110,7 @@ def delete_view(self, request, object_id, extra_context=None):

if request.POST:
# Return to folder listing, since there is no usable file listing.
super(FileAdmin, self).delete_view(
super().delete_view(
request=request, object_id=object_id,
extra_context=extra_context)
if parent_folder:
Expand All @@ -127,7 +124,7 @@ def delete_view(self, request, object_id, extra_context=None):
)
return HttpResponseRedirect(url)

return super(FileAdmin, self).delete_view(
return super().delete_view(
request=request, object_id=object_id,
extra_context=extra_context)

Expand Down
Loading