Skip to content

Commit

Permalink
Merge pull request #4 from djk2/issue#3
Browse files Browse the repository at this point in the history
Issue#3
  • Loading branch information
djk2 authored Feb 27, 2018
2 parents 839fea7 + 9cc8996 commit a9e16c0
Show file tree
Hide file tree
Showing 14 changed files with 241 additions and 93 deletions.
225 changes: 171 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,180 @@ language: python

matrix:
include:
- { python 3.4, env: TOXENV=py34-djmaster-dt1.6-tests }
- { python 2.7, env: TOXENV=py27-dj1.9-dt1.5-tests }
- { python 2.7, env: TOXENV=py27-dj1.9-dt1.6-tests }
- { python 2.7, env: TOXENV=py27-dj1.9-dtmaster-tests }
- { python 2.7, env: TOXENV=py27-dj1.10-dt1.5-tests }
- { python 2.7, env: TOXENV=py27-dj1.10-dt1.6-tests }
- { python 2.7, env: TOXENV=py27-dj1.10-dtmaster-tests }
- { python 2.7, env: TOXENV=py27-dj1.11-dt1.5-tests }
- { python 2.7, env: TOXENV=py27-dj1.11-dt1.6-tests }
- { python 2.7, env: TOXENV=py27-dj1.11-dtmaster-tests }
- { python 3.4, env: TOXENV=py34-dj1.9-dt1.5-tests }
- { python 3.4, env: TOXENV=py34-dj1.9-dt1.6-tests }
- { python 3.4, env: TOXENV=py34-dj1.9-dtmaster-tests }
- { python 3.4, env: TOXENV=py34-dj1.10-dt1.5-tests }
- { python 3.4, env: TOXENV=py34-dj1.10-dt1.6-tests }
- { python 3.4, env: TOXENV=py34-dj1.10-dtmaster-tests }
- { python 3.4, env: TOXENV=py34-dj1.11-dt1.5-tests }
- { python 3.4, env: TOXENV=py34-dj1.11-dt1.6-tests }
- { python 3.4, env: TOXENV=py34-dj1.11-dtmaster-tests }
- { python 2.7, env: TOXENV=py27-dj1.9-dt1.1-tests }
- { python 2.7, env: TOXENV=py27-dj1.9-dt1.2-tests }
- { python 2.7, env: TOXENV=py27-dj1.9-dt1.3-tests }
- { python 2.7, env: TOXENV=py27-dj1.9-dt1.4-tests }
- { python 2.7, env: TOXENV=py27-dj1.10-dt1.1-tests }
- { python 2.7, env: TOXENV=py27-dj1.10-dt1.2-tests }
- { python 2.7, env: TOXENV=py27-dj1.10-dt1.3-tests }
- { python 2.7, env: TOXENV=py27-dj1.10-dt1.4-tests }
- { python 2.7, env: TOXENV=py27-dj1.11-dt1.1-tests }
- { python 2.7, env: TOXENV=py27-dj1.11-dt1.2-tests }
- { python 2.7, env: TOXENV=py27-dj1.11-dt1.3-tests }
- { python 2.7, env: TOXENV=py27-dj1.11-dt1.4-tests }
- { python 3.4, env: TOXENV=py34-dj1.9-dt1.1-tests }
- { python 3.4, env: TOXENV=py34-dj1.9-dt1.2-tests }
- { python 3.4, env: TOXENV=py34-dj1.9-dt1.3-tests }
- { python 3.4, env: TOXENV=py34-dj1.9-dt1.4-tests }
- { python 3.4, env: TOXENV=py34-dj1.10-dt1.1-tests }
- { python 3.4, env: TOXENV=py34-dj1.10-dt1.2-tests }
- { python 3.4, env: TOXENV=py34-dj1.10-dt1.3-tests }
- { python 3.4, env: TOXENV=py34-dj1.10-dt1.4-tests }
- { python 3.4, env: TOXENV=py34-dj1.11-dt1.1-tests }
- { python 3.4, env: TOXENV=py34-dj1.11-dt1.2-tests }
- { python 3.4, env: TOXENV=py34-dj1.11-dt1.3-tests }
- { python 3.4, env: TOXENV=py34-dj1.11-dt1.4-tests }
- { python 2.7, env: TOXENV=py27-dj1.11-dt1.4-tests }
- { python 3.4, env: TOXENV=py34-dj1.11-dt1.4-tests }
- { python 2.7, env: TOXENV=py27-flake }
- { python 3.4, env: TOXENV=py34-flake }
- { python 3.4, env: TOXENV=py34-isort }
- python: '3.6'
env: TOXENV=py36-dj2.0-dt1.17-tests
- python: '3.6'
env: TOXENV=py36-dj2.0-dt1.18-tests
- python: '3.6'
env: TOXENV=py36-dj2.0-dt1.19-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.17-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.18-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.19-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.17-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.18-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.19-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.5-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.6-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.7-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.8-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.9-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.10-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.11-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.12-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.13-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.14-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.15-tests
- python: '2.7'
env: TOXENV=py27-dj1.9-dt1.16-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.5-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.6-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.7-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.8-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.9-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.10-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.11-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.12-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.13-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.14-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.15-tests
- python: '2.7'
env: TOXENV=py27-dj1.10-dt1.16-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.5-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.6-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.7-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.8-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.9-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.10-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.11-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.12-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.13-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.14-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.15-tests
- python: '2.7'
env: TOXENV=py27-dj1.11-dt1.16-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.5-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.6-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.7-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.8-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.9-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.10-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.11-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.12-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.13-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.14-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.15-tests
- python: '3.6'
env: TOXENV=py36-dj1.9-dt1.16-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.5-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.6-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.7-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.8-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.9-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.10-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.11-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.12-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.13-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.14-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.15-tests
- python: '3.6'
env: TOXENV=py36-dj1.10-dt1.16-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.5-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.6-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.7-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.8-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.9-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.10-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.11-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.12-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.13-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.14-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.15-tests
- python: '3.6'
env: TOXENV=py36-dj1.11-dt1.16-tests
- python: '2.7'
env: TOXENV=py27-flake
- python: '3.6'
env: TOXENV=py36-flake
- python: '3.6'
env: TOXENV=py36-isort

allow_failures:
- env: TOXENV=py34-djmaster-dt1.6-tests
- env: TOXENV=py27-dj1.9-dtmaster-tests
- env: TOXENV=py27-dj1.10-dtmaster-tests
- env: TOXENV=py36-djmaster-dtmaster-tests
- env: TOXENV=py36-dj2.0-dtmaster-tests
- env: TOXENV=py27-dj1.11-dtmaster-tests
- env: TOXENV=py34-dj1.9-dtmaster-tests
- env: TOXENV=py34-dj1.10-dtmaster-tests
- env: TOXENV=py34-dj1.11-dtmaster-tests
- env: TOXENV=py36-dj1.11-dtmaster-tests

install:
- pip install tox>=2.5.0
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
===========

v. 0.4.0
---------
* Support for django-tables2 v1.19.0 and all previous versions
* Remove support for django-tables2 < v1.5.0


v. 0.3.1
---------
* Support for django-tables2 v1.5 and v1.6
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ Using JQuery, Bootstrap3 or Bootstrap4 and Django >=1.9.

- Tested by tox with:

* Python :2.7, 3.4
* Django : 1.9, 1.10, 1.11, 2.0-dev
* django-tables2 : 1.1.8, 1.2.6, 1.3.0, 1.4, 1.5, 1.6.1, master
* Python :2.7, 3.6
* Django : 1.9, 1.10, 1.11, 2.0
* django-tables2 : 1.5, 1.6, ..., 1.19, master

- Require:

* Django >= 1.9
* django-tables2 >= 1.1.0 (earlier version probably will be work but wasn't tested)
* django-tables2 >= 1.5.0 (earlier version probably will be work but wasn't tested)
* **bootstrap3** or **bootstrap4**
* **JQuery**

- Supported locale:

* EN - (english)
* PL - (polish)
* EN - (English)
* PL - (Polish)



Expand Down
2 changes: 1 addition & 1 deletion django_tables2_column_shifter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = (0, 3, 1)
VERSION = (0, 4, 0)
__version__ = ".".join(str(i) for i in VERSION)
5 changes: 4 additions & 1 deletion django_tables2_column_shifter/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ def __init__(self, *args, **kwargs):
"""Override init for set shifter template"""
super(ColumnShiftTable, self).__init__(*args, **kwargs)
# Override default template
self.template = self.shifter_template
if hasattr(self, "template_name"):
self.template_name = self.shifter_template
else:
self.template = self.shifter_template

def get_column_default_show(self):
"""
Expand Down
22 changes: 15 additions & 7 deletions django_tables2_column_shifter/tests/test_base.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# encoding: utf-8
from os import path

import django_tables2 as tables
from django.contrib.staticfiles import finders
from django.test import Client, TestCase

from django_tables2_column_shifter.tests.models import Author


Expand Down Expand Up @@ -60,14 +62,20 @@ def test_is_pagination(self):
def test_tables_template(self):
response = self.client.get('/')
template_name = "django_tables2_column_shifter/bootstrap3.html"
assert response.context['author_table1'].template is not None
assert response.context['author_table1'].template == template_name

assert response.context['author_table2'].template is not None
assert response.context['author_table2'].template == template_name

assert response.context['book_table'].template is not None
assert response.context['book_table'].template == template_name
# In django_table2 v1.18 was renamed Table.Meta.template to template_name
version = tuple(map(int, tables.__version__.split(".")))
if version < (1, 18):
template_attr_name = 'template'
else:
template_attr_name = 'template_name'

assert getattr(response.context['author_table1'], template_attr_name) is not None
assert getattr(response.context['author_table1'], template_attr_name) == template_name
assert getattr(response.context['author_table2'], template_attr_name) is not None
assert getattr(response.context['author_table2'], template_attr_name) == template_name
assert getattr(response.context['book_table'], template_attr_name) is not None
assert getattr(response.context['book_table'], template_attr_name) == template_name

def test_static_files(self):
prefix = "django_tables2_column_shifter"
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Django>=1.11.1
django-tables2>=1.6.1
Django>=2.0.2
django-tables2>=1.19.0
tox>=2.5.0
flake8
twine
Expand Down
4 changes: 0 additions & 4 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
from django.test.utils import get_runner

if __name__ == "__main__":
'''
Testy projektu, przechodzimy po katalogu 'moduly' i dla
każdego modułu wykonujemy testy zamieszczone w katalogu 'testy'
'''
warnings.simplefilter('always', DeprecationWarning)

app_dir = os.path.join(os.path.dirname(__file__), 'django_tables2_column_shifter')
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def readme():
tests_require=['Django', 'django-tables2'],
include_package_data=True,
zip_safe=False,
install_requires=['Django>=1.9', 'django-tables2>=1.1.0'],
install_requires=['Django>=1.9', 'django-tables2>=1.5.0'],
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
Expand All @@ -32,7 +32,7 @@ def readme():
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.6',
'Topic :: Utilities',
],
keywords='django_tables2 django columns',
Expand Down
Binary file modified testproject/db.sqlite3
Binary file not shown.
4 changes: 2 additions & 2 deletions testproject/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Django==1.11.1
django-tables2==1.6.1
Django==2.0.2
django-tables2==1.19.0
../.
6 changes: 2 additions & 4 deletions testproject/testproject/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10rc1 on 2016-11-21 13:45
from __future__ import unicode_literals
# Generated by Django 2.0.2 on 2018-02-27 13:49

import django.db.models.deletion
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
Expand Down
8 changes: 7 additions & 1 deletion testproject/testproject/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ class Book(models.Model):
pages = models.IntegerField("Count pages")

# FK
author = models.ForeignKey(Author, verbose_name='Author', null=True, blank=True)
author = models.ForeignKey(
Author,
verbose_name='Author',
null=True,
blank=True,
on_delete=models.CASCADE
)
Loading

0 comments on commit a9e16c0

Please sign in to comment.