Skip to content

Commit

Permalink
Merge branch 'release/1.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
asyncee committed Jan 12, 2016
2 parents b960749 + 348b7d2 commit f477cc5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ in admin.


Project aims to support **Python 2.7** and **3.4** (at least),
**Django 1.6**, **1.7** and **1.8**.
**Django 1.7**, **1.8** and **1.9**.


**UPGRADE NOTES** : Version 1.3 introduced backward incompatible
Expand Down
6 changes: 6 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

Version 1.3.2
-------------

- Fixed #24, big thanks to *Andrzej Mateja*


Version 1.3.1
-------------

Expand Down
28 changes: 14 additions & 14 deletions easy_select2/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

import django
from django import forms
from django.contrib.staticfiles.storage import staticfiles_storage
from django.conf import settings
from django.utils.safestring import mark_safe


static = staticfiles_storage.url


SELECT2_JS = getattr(
settings,
'SELECT2_JS',
Expand All @@ -29,20 +25,20 @@
lookup_override_filename = 'lookup_override.1.8.js'

SELECT2_WIDGET_JS = [
static('easy_select2/js/init.js'),
static('easy_select2/js/easy_select2.js'),
static('easy_select2/js/{}'.format(lookup_override_filename)),
static(SELECT2_JS),
'easy_select2/js/init.js',
'easy_select2/js/easy_select2.js',
'easy_select2/js/{}'.format(lookup_override_filename),
SELECT2_JS,
]

if SELECT2_USE_BUNDLED_JQUERY:
jquery_min_file = 'easy_select2/vendor/jquery/jquery.min.js'
SELECT2_WIDGET_JS.insert(0, static(jquery_min_file))
SELECT2_WIDGET_JS.insert(0, jquery_min_file)

SELECT2_WIDGET_CSS = {
'screen': [
static(SELECT2_CSS),
static('easy_select2/css/easy_select2.css'),
SELECT2_CSS,
'easy_select2/css/easy_select2.css',
],
}

Expand Down Expand Up @@ -114,9 +110,13 @@ def render(self, *args, **kwargs):

return mark_safe(output)

class Media:
js = SELECT2_WIDGET_JS
css = SELECT2_WIDGET_CSS
def _media(self):
return forms.Media(
js=SELECT2_WIDGET_JS,
css=SELECT2_WIDGET_CSS,
)

media = property(_media)


class Select2(Select2Mixin, forms.Select):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def run_tests(self):

setup(
name="django-easy-select2",
version="1.3.1",
version="1.3.2",
packages=find_packages(),
author="asyncee",
description="Django select2 theme for select input widgets.",
Expand Down
3 changes: 2 additions & 1 deletion tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest
import mock
from django.contrib.staticfiles.storage import staticfiles_storage

from easy_select2 import widgets

Expand Down Expand Up @@ -78,7 +79,7 @@ def test_staticfiles_url(settings):
css = widgets.SELECT2_WIDGET_CSS

def all_startswith(string, iterable):
return all([x.startswith(string) for x in iterable])
return all([staticfiles_storage.url(x).startswith(string) for x in iterable])

assert all_startswith(
settings.STATIC_URL,
Expand Down
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,34}-{django16,django17,django18},coverage
envlist = py{27,34}-{django17,django18,django19},coverage

[base]
deps =
Expand All @@ -13,16 +13,16 @@ setenv =
[testenv]
deps =
{[base]deps}
django16: django==1.6
django17: django==1.7
django18: django==1.8
django17: django>=1.7,<1.8
django18: django>=1.8,<1.9
django19: django>=1.9,<1.10
commands = py.test tests
setenv = {[base]setenv}

[testenv:coverage]
deps =
{[base]deps}
django==1.8
django==1.9
coverage
coveralls
commands =
Expand Down

0 comments on commit f477cc5

Please sign in to comment.