Skip to content

Commit

Permalink
Merge branch 'feature/django-1.10' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed Sep 7, 2016
2 parents bd5cdd5 + 8dbca46 commit 710ffa5
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 65 deletions.
10 changes: 5 additions & 5 deletions demo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@
('zh-hans', gettext('Simplified Chinese')),
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.admindocs.middleware.XViewMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'demo.urls'

Expand Down
8 changes: 4 additions & 4 deletions docs/getting-started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Dependencies
Make sure to install these packages prior to installation :

* `Python`_ >= 2.7
* `Django`_ >= 1.9,<1.10
* `Django`_ >= 1.10,<1.11
* `Pillow`_ >= 2.0.0
* `django-mptt`_ >= 0.5.1
* `django-tagging`_ >= 0.3.6
* `django-mptt`_ >= 0.8.6
* `django-tagging`_ >= 0.4.5
* `beautifulsoup4`_ >= 4.1.3
* `mots-vides`_ >= 2015.2.6
* `regex`_ >= 2016.3.2
* `django-contrib-comments`_ >= 1.6
* `django-contrib-comments`_ >= 1.7

The packages below are optionnal but needed for run the full test suite or
migrate the database.
Expand Down
12 changes: 10 additions & 2 deletions docs/notes/compatibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ readability and to be always present when the version 3.4.2 of Django will
be here. :)

Predicting the future is a good thing, because it's coming soon.
Actually Zinnia is designed to handle the 1.8.x version and will reach the
release 1.10 easily without major changes.
Actually Zinnia is designed to handle the 1.10.x version and will reach the
release 1.12 easily without major changes.

https://docs.djangoproject.com/en/dev/internals/deprecation/

Expand All @@ -23,6 +23,14 @@ Compatibility with Django

Here a list establishing the compatibility between Zinnia and Django:

.. versionchanged:: 0.18

Backward incompatibilities with Django v1.9.x due to :

* Removal of allow_tags property in django.contrib.admin
* Changes in prototype of widget.render_options
* Use of the new property user.is_authenticated

.. versionchanged:: 0.17

Backward incompatibilities with Django v1.8.x due to :
Expand Down
16 changes: 8 additions & 8 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
beautifulsoup4==4.4.1
django==1.9.6
django-contrib-comments==1.7.1
django-mptt==0.8.2
django-tagging==0.4.3
beautifulsoup4==4.5.1
django==1.10
django-contrib-comments==1.7.2
django-mptt==0.8.6
django-tagging==0.4.5
django-xmlrpc==0.1.5
mots-vides==2015.5.11
pillow==3.2.0
pyparsing==2.1.1
regex==2016.3.2
pillow==3.3.1
pyparsing==2.1.8
regex==2016.8.27
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
include_package_data=True,
zip_safe=False,
install_requires=['beautifulsoup4>=4.3.2',
'django-contrib-comments>=1.6.0',
'django-mptt>=0.6.1',
'django-tagging>=0.3.6',
'django-contrib-comments>=1.7.2',
'django-mptt>=0.8.6',
'django-tagging>=0.4.5',
'django-xmlrpc>=0.1.5',
'mots-vides>=2015.5.11',
'pillow>=2.0.0',
Expand Down
3 changes: 3 additions & 0 deletions travis.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ defaults = --with-sfd
[coveralls]
recipe = zc.recipe.egg
eggs = python-coveralls

[versions]
coverage = 4.0.3
43 changes: 23 additions & 20 deletions versions.cfg
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
[versions]
alabaster = 0.7.7
alabaster = 0.7.9
babel = 2.3.4
beautifulsoup4 = 4.4.1
beautifulsoup4 = 4.5.1
blessings = 1.6
buildout-versions-checker = 1.9.3
collective.recipe.sphinxbuilder = 0.8.2
coverage = 4.0.3
django = 1.9.6
django-contrib-comments = 1.7.1
django-mptt = 0.8.2
django-tagging = 0.4.3
collective.recipe.sphinxbuilder = 1.0
configparser = 3.5.0
coverage = 4.2
django = 1.10.1
django-contrib-comments = 1.7.2
django-mptt = 0.8.6
django-tagging = 0.4.5
django-xmlrpc = 0.1.5
djangorecipe = 2.1.2
djangorecipe = 2.2.1
docutils = 0.12
flake8 = 2.5.4
enum34 = 1.1.6
flake8 = 3.0.4
futures = 3.0.5
imagesize = 0.7.1
jinja2 = 2.8
markdown = 2.6.6
markupsafe = 0.23
mccabe = 0.4.0
mccabe = 0.5.2
mots-vides = 2015.5.11
nose = 1.3.7
nose-progressive = 1.5.1
nose-sfd = 0.4
packaging = 16.7
pbp.recipe.noserunner = 0.2.6
pep8 = 1.7.0
pillow = 3.2.0
pillow = 3.3.1
pycodestyle = 2.0.0
pyflakes = 1.0.0
pygments = 2.1.3
pyparsing = 2.1.1
pyparsing = 2.1.8
python-coveralls = 2.7.0
pytz = 2016.4
pyyaml = 3.11
regex = 2016.4.25
requests = 2.10.0
pytz = 2016.6.1
pyyaml = 3.12
regex = 2016.8.27
requests = 2.11.1
sh = 1.11
six = 1.10.0
snowballstemmer = 1.2.1
sphinx = 1.4.1
sphinx = 1.4.6
sphinx-rtd-theme = 0.1.9
textile = 2.2.2
zc.buildout = 2.5.1
textile = 2.3.3
zc.buildout = 2.5.3
zc.recipe.egg = 2.0.3
1 change: 0 additions & 1 deletion zinnia/admin/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ def get_tree_path(self, category):
category.get_absolute_url(), category.tree_path)
except NoReverseMatch:
return '/%s/' % category.tree_path
get_tree_path.allow_tags = True
get_tree_path.short_description = _('tree path')
5 changes: 0 additions & 5 deletions zinnia/admin/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def get_authors(self, entry):
return ', '.join(
[conditional_escape(getattr(author, author.USERNAME_FIELD))
for author in entry.authors.all()])
get_authors.allow_tags = True
get_authors.short_description = _('author(s)')

def get_categories(self, entry):
Expand All @@ -123,7 +122,6 @@ def get_categories(self, entry):
except NoReverseMatch:
return ', '.join([conditional_escape(category.title)
for category in entry.categories.all()])
get_categories.allow_tags = True
get_categories.short_description = _('category(s)')

def get_tags(self, entry):
Expand All @@ -137,7 +135,6 @@ def get_tags(self, entry):
for tag in entry.tags_list])
except NoReverseMatch:
return conditional_escape(entry.tags)
get_tags.allow_tags = True
get_tags.short_description = _('tag(s)')

def get_sites(self, entry):
Expand All @@ -152,7 +149,6 @@ def get_sites(self, entry):
', ', '<a href="{}://{}{}" target="blank">{}</a>',
[(settings.PROTOCOL, site.domain, index_url,
conditional_escape(site.name)) for site in entry.sites.all()])
get_sites.allow_tags = True
get_sites.short_description = _('site(s)')

def get_short_url(self, entry):
Expand All @@ -165,7 +161,6 @@ def get_short_url(self, entry):
short_url = entry.get_absolute_url()
return format_html('<a href="{url}" target="blank">{url}</a>',
url=short_url)
get_short_url.allow_tags = True
get_short_url.short_description = _('short url')

def get_is_visible(self, entry):
Expand Down
6 changes: 2 additions & 4 deletions zinnia/admin/widgets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Widgets for Zinnia admin"""
import json
from itertools import chain

from django.utils import six
from django.forms import Media
Expand Down Expand Up @@ -47,7 +46,7 @@ def render_option(self, selected_choices, option_value,
option_label, option_value, selected_html,
sort_fields[0], sort_fields[1])

def render_options(self, choices, selected_choices):
def render_options(self, selected_choices):
"""
This is copy'n'pasted from django.forms.widgets Select(Widget)
change to the for loop and render_option so they will unpack
Expand All @@ -57,8 +56,7 @@ def render_options(self, choices, selected_choices):
"""
selected_choices = set(force_text(v) for v in selected_choices)
output = []
for option_value, option_label, sort_fields in chain(
self.choices, choices):
for option_value, option_label, sort_fields in self.choices:
output.append(self.render_option(
selected_choices, option_value,
option_label, sort_fields))
Expand Down
5 changes: 2 additions & 3 deletions zinnia/tests/implementations/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
'django.contrib.auth.hashers.SHA1PasswordHasher'
]

MIDDLEWARE_CLASSES = [
MIDDLEWARE = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware'
]

TEMPLATES = [
Expand Down
15 changes: 6 additions & 9 deletions zinnia/tests/test_admin_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,21 @@ def test_render_option_non_ascii_issue_317(self):

def test_render_options(self):
widget = MPTTFilteredSelectMultiple('test', False)
self.assertEqual(widget.render_options([], []), '')
self.assertEqual(widget.render_options([]), '')

options = widget.render_options([
choices = [
(1, 'Category 1', (1, 1)),
(2, '|-- Category 2', (1, 2))], [])
(2, '|-- Category 2', (1, 2))]
widget = MPTTFilteredSelectMultiple('test', False, choices=choices)

self.assertEqual(
options,
widget.render_options([]),
'<option value="1" data-tree-id="1" data-left-value="1">'
'Category 1</option>\n<option value="2" data-tree-id="1" '
'data-left-value="2">|-- Category 2</option>')

options = widget.render_options([
(1, 'Category 1', (1, 1)),
(2, '|-- Category 2', (1, 2))], [2])

self.assertEqual(
options,
widget.render_options([2]),
'<option value="1" data-tree-id="1" data-left-value="1">'
'Category 1</option>\n<option value="2" selected="selected" '
'data-tree-id="1" data-left-value="2">|-- Category 2</option>')
Expand Down
2 changes: 1 addition & 1 deletion zinnia/views/mixins/entry_protection.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get(self, request, *args, **kwargs):
"""
response = super(EntryProtectionMixin, self).get(
request, *args, **kwargs)
if self.object.login_required and not request.user.is_authenticated():
if self.object.login_required and not request.user.is_authenticated:
return self.login()
if (self.object.password and self.object.password !=
self.request.session.get(self.session_key % self.object.pk)):
Expand Down

0 comments on commit 710ffa5

Please sign in to comment.