From bc816d98f4c288327708dd9501aeee8141c0a7d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Wed, 23 Aug 2017 13:12:58 +0200 Subject: [PATCH 01/15] _report is _export, really --- docs/pages/export.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/export.rst b/docs/pages/export.rst index 90a639ba..69dd696f 100644 --- a/docs/pages/export.rst +++ b/docs/pages/export.rst @@ -25,7 +25,7 @@ Adding ability to export the table data to a class based views looks like this:: template_name = 'django_tables2/bootstrap.html' -Now, if you append ``_report=csv`` to the querystring, the browser will download +Now, if you append ``_export=csv`` to the querystring, the browser will download a csv file containing your data. Supported export formats are: csv, json, latex, ods, tsv, xls, xlsx, yml From 28a2f36156808b8d4f4f5ff33832c19c164e2365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 17 Nov 2017 14:24:04 +0100 Subject: [PATCH 02/15] Add BeautifulSoup4 dependency, as some tests are going to need it because of more and more complicated HTML generated by dt2 --- requirements/common.pip | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/common.pip b/requirements/common.pip index 08b7da4b..d006b080 100644 --- a/requirements/common.pip +++ b/requirements/common.pip @@ -7,3 +7,4 @@ pytest pytest-django pytest-cov tablib==0.11.4 +BeautifulSoup4 \ No newline at end of file From 702b8a7fee4b7d6c92622890b3d9b257a98dfb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 17 Nov 2017 14:24:45 +0100 Subject: [PATCH 03/15] Switch to BeautifulSoup4 so when the fix for #499 comes, we will be analysing HTML and not just comparing simple strings. --- tests/test_footer.py | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/tests/test_footer.py b/tests/test_footer.py index 66684634..b294039e 100644 --- a/tests/test_footer.py +++ b/tests/test_footer.py @@ -1,4 +1,6 @@ # coding: utf-8 +from bs4 import BeautifulSoup + import django_tables2 as tables from .utils import build_request @@ -34,8 +36,12 @@ class Table(tables.Table): html = table.as_html(build_request('/')) - assert 'Total:' in html - assert '18833000' in html + soup = BeautifulSoup(html, "lxml") + row = soup.find("tfoot").tr + columns = row.find_all("td") + + assert columns[1].text == "Total:" + assert columns[2].text == "18833000" def test_footer_disable_on_table(): @@ -51,18 +57,24 @@ class Table(tables.Table): assert table.has_footer() is False -def test_footer_column_method(): +class SummingColumn(tables.Column): + def render_footer(self, bound_column, table): + return sum(bound_column.accessor.resolve(row) for row in table.data) - class SummingColumn(tables.Column): - def render_footer(self, bound_column, table): - return sum(bound_column.accessor.resolve(row) for row in table.data) - class Table(tables.Table): - name = tables.Column() - country = tables.Column(footer='Total:') - population = SummingColumn() +class TestTable(tables.Table): + name = tables.Column() + country = tables.Column(footer='Total:') + population = SummingColumn() - table = Table(MEMORY_DATA) + +def test_footer_column_method(): + table = TestTable(MEMORY_DATA) html = table.as_html(build_request('/')) - assert 'Total:' in html - assert '18833000' in html + + soup = BeautifulSoup(html, "lxml") + row = soup.find("tfoot").tr + columns = row.find_all("td") + + assert columns[1].text == "Total:" + assert columns[2].text == "18833000" From ab885fccdfe1e592b0b72878a24a0dca6f95e45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 17 Nov 2017 14:25:18 +0100 Subject: [PATCH 04/15] =?UTF-8?q?Add=20a=20failing=20test=20for=20footer?= =?UTF-8?q?=20columns=20without=20=E2=80=9Eclass=E2=80=9D=20attribute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_footer.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_footer.py b/tests/test_footer.py index b294039e..709404a9 100644 --- a/tests/test_footer.py +++ b/tests/test_footer.py @@ -78,3 +78,14 @@ def test_footer_column_method(): assert columns[1].text == "Total:" assert columns[2].text == "18833000" + + +def test_footer_has_class(): + table = TestTable(MEMORY_DATA) + html = table.as_html(build_request('/')) + + soup = BeautifulSoup(html, "lxml") + row = soup.find("tfoot").tr + columns = row.find_all("td") + + assert "class" in columns[1].attrs From 72a81091be55090b9af898b0dde724e5e51963de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 17 Nov 2017 14:30:58 +0100 Subject: [PATCH 05/15] A typo --- django_tables2/columns/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_tables2/columns/base.py b/django_tables2/columns/base.py index 93f6dba5..eb5719a2 100644 --- a/django_tables2/columns/base.py +++ b/django_tables2/columns/base.py @@ -83,7 +83,7 @@ class Column(object): the data iterator returned from as_values(). footer (str, callable): Defines the footer of this column. If a callable is passed, it can take optional keyword argumetns `column`, - `bound_colun` and `table`. + `bound_column` and `table`. order_by (str, tuple or `.Accessor`): Allows one or more accessors to be used for ordering rather than *accessor*. orderable (bool): If `False`, this column will not be allowed to From 0d6334550a61bd55842929e96897404ff2858f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 17 Nov 2017 15:09:24 +0100 Subject: [PATCH 06/15] =?UTF-8?q?Add=20support=20for=20footer=20attributes?= =?UTF-8?q?,=20especially=20the=20=E2=80=9Eclass=E2=80=9D=20attribute.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- django_tables2/columns/base.py | 10 ++-- .../templates/django_tables2/semantic.html | 2 +- .../templates/django_tables2/table.html | 2 +- tests/test_faq.py | 8 ++- tests/test_footer.py | 50 +++++++++++++++---- 5 files changed, 56 insertions(+), 16 deletions(-) diff --git a/django_tables2/columns/base.py b/django_tables2/columns/base.py index eb5719a2..1376edb2 100644 --- a/django_tables2/columns/base.py +++ b/django_tables2/columns/base.py @@ -297,9 +297,10 @@ def attrs(self): ''' Proxy to `.Column.attrs` but injects some values of our own. - A ``th`` and ``td`` are guaranteed to be defined (irrespective of - what's actually defined in the column attrs. This makes writing - templates easier. + A ``th``, ``td`` and ``tf`` are guaranteed to be defined (irrespective + of what's actually defined in the column attrs. This makes writing + templates easier. ``tf`` is not actually a HTML tag, but this key name + will be used for attributes for column's footer, if the column has one. ''' # Start with table's attrs; Only 'th' and 'td' attributes will be used attrs = dict(self._table.attrs) @@ -316,14 +317,17 @@ def attrs(self): } attrs['th'] = computed_values(attrs.get('th', cell_attrs), kwargs=kwargs) attrs['td'] = computed_values(attrs.get('td', cell_attrs), kwargs=kwargs) + attrs['tf'] = computed_values(attrs.get('tf', cell_attrs), kwargs=kwargs) # wrap in AttributeDict attrs['th'] = AttributeDict(attrs['th']) attrs['td'] = AttributeDict(attrs['td']) + attrs['tf'] = AttributeDict(attrs['tf']) # Override/add classes attrs['th']['class'] = self.get_th_class(attrs['th']) attrs['td']['class'] = self.get_td_class(attrs['td']) + attrs['tf']['class'] = self.get_td_class(attrs['tf']) return attrs diff --git a/django_tables2/templates/django_tables2/semantic.html b/django_tables2/templates/django_tables2/semantic.html index 508536e9..92bc98c8 100644 --- a/django_tables2/templates/django_tables2/semantic.html +++ b/django_tables2/templates/django_tables2/semantic.html @@ -43,7 +43,7 @@ {% if table.has_footer %} {% for column in table.columns %} - {{ column.footer }} + {{ column.footer }} {% endfor %} {% endif %} diff --git a/django_tables2/templates/django_tables2/table.html b/django_tables2/templates/django_tables2/table.html index bf8b3572..095754c2 100644 --- a/django_tables2/templates/django_tables2/table.html +++ b/django_tables2/templates/django_tables2/table.html @@ -43,7 +43,7 @@ {% for column in table.columns %} - {{ column.footer }} + {{ column.footer }} {% endfor %} diff --git a/tests/test_faq.py b/tests/test_faq.py index aa0e54e9..4d3da16d 100644 --- a/tests/test_faq.py +++ b/tests/test_faq.py @@ -1,5 +1,7 @@ import itertools +from bs4 import BeautifulSoup + import django_tables2 as tables from .utils import build_request @@ -44,4 +46,8 @@ class CountryTable(tables.Table): table = CountryTable(TEST_DATA) html = table.as_html(build_request()) - assert 'Total: 77740000' in html + soup = BeautifulSoup(html, "lxml") + row = soup.find("tfoot").tr + columns = row.find_all("td") + + assert columns[1].text == "Total: 77740000" diff --git a/tests/test_footer.py b/tests/test_footer.py index 709404a9..ada410e2 100644 --- a/tests/test_footer.py +++ b/tests/test_footer.py @@ -57,18 +57,17 @@ class Table(tables.Table): assert table.has_footer() is False -class SummingColumn(tables.Column): - def render_footer(self, bound_column, table): - return sum(bound_column.accessor.resolve(row) for row in table.data) - - -class TestTable(tables.Table): - name = tables.Column() - country = tables.Column(footer='Total:') - population = SummingColumn() +def test_footer_column_method(): + class SummingColumn(tables.Column): + def render_footer(self, bound_column, table): + return sum( + bound_column.accessor.resolve(row) for row in table.data) + class TestTable(tables.Table): + name = tables.Column() + country = tables.Column(footer='Total:') + population = SummingColumn() -def test_footer_column_method(): table = TestTable(MEMORY_DATA) html = table.as_html(build_request('/')) @@ -81,6 +80,16 @@ def test_footer_column_method(): def test_footer_has_class(): + class SummingColumn(tables.Column): + def render_footer(self, bound_column, table): + return sum( + bound_column.accessor.resolve(row) for row in table.data) + + class TestTable(tables.Table): + name = tables.Column() + country = tables.Column(footer='Total:') + population = SummingColumn() + table = TestTable(MEMORY_DATA) html = table.as_html(build_request('/')) @@ -89,3 +98,24 @@ def test_footer_has_class(): columns = row.find_all("td") assert "class" in columns[1].attrs + + +def test_footer_custom_attriubtes(): + class SummingColumn(tables.Column): + def render_footer(self, bound_column, table): + return sum( + bound_column.accessor.resolve(row) for row in table.data) + + class TestTable(tables.Table): + name = tables.Column() + country = tables.Column(footer='Total:', attrs={'tf': {'align': 'right'}}) + population = SummingColumn() + + table = TestTable(MEMORY_DATA) + table.columns['country'].attrs['tf'] = {'align': 'right'} + html = table.as_html(build_request('/')) + + soup = BeautifulSoup(html, "lxml") + row = soup.find("tfoot").tr + columns = row.find_all("td") + assert "align" in columns[1].attrs From a799046912fbebc043590b84d8fac0f3ab96dbb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 17 Nov 2017 15:27:08 +0100 Subject: [PATCH 07/15] isort --- tests/test_faq.py | 3 +-- tests/test_footer.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_faq.py b/tests/test_faq.py index 4d3da16d..95454528 100644 --- a/tests/test_faq.py +++ b/tests/test_faq.py @@ -1,8 +1,7 @@ import itertools -from bs4 import BeautifulSoup - import django_tables2 as tables +from bs4 import BeautifulSoup from .utils import build_request diff --git a/tests/test_footer.py b/tests/test_footer.py index ada410e2..32d48d0e 100644 --- a/tests/test_footer.py +++ b/tests/test_footer.py @@ -1,7 +1,6 @@ # coding: utf-8 -from bs4 import BeautifulSoup - import django_tables2 as tables +from bs4 import BeautifulSoup from .utils import build_request From 969f06ba080aa00a41f29db3ccfd260b4164f1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 17 Nov 2017 15:44:38 +0100 Subject: [PATCH 08/15] Document the changes --- docs/pages/custom-rendering.rst | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/pages/custom-rendering.rst b/docs/pages/custom-rendering.rst index 32c3dbad..a75e10cf 100644 --- a/docs/pages/custom-rendering.rst +++ b/docs/pages/custom-rendering.rst @@ -25,6 +25,40 @@ a hook that allows arbitrary attributes to be added to the ```` tag. >>> # renders to something like this: '
...' +How about styling individual columns then? django-tables2 has you covered. +Ever single column gets a class attribute, which by default is the same +as the column's label. So every row of the ``SimpleTable()`` from previous +example will look like: + +.. sourcecode:: html + + + + + + +You can also specify ``attrs`` attribute when creating a column. django-tables2 +supports 3 different dictionaries, this way you can give different attributes +to column tags in table header (``th``), rows (``td``) or footer (``tf``) + +.. sourcecode:: python + + >>> import django_tables2 as tables + >>> + >>> class SimpleTable(tables.Table): + ... id = tables.Column(attrs={'td': {'class': 'my-class'}}) + ... age = tables.Column(attrs={'tf': {'bgcolor': 'red'}}) + ... + ... class Meta: + ... attrs = {'class': 'mytable'} + ... + >>> table = SimpleTable() + >>> # renders to something like this: + '' + >>> # and the footer will look like this: + ' ... '' + + .. _custom-template: Custom Template From 4e1a9be3b38b5891387598509f3a301104d5e610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 17 Nov 2017 16:09:58 +0100 Subject: [PATCH 09/15] Default row styling, style, typos --- docs/pages/custom-rendering.rst | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/pages/custom-rendering.rst b/docs/pages/custom-rendering.rst index a75e10cf..2076ff86 100644 --- a/docs/pages/custom-rendering.rst +++ b/docs/pages/custom-rendering.rst @@ -25,18 +25,23 @@ a hook that allows arbitrary attributes to be added to the ``
......
...
`` tag. >>> # renders to something like this: '
...' -How about styling individual columns then? django-tables2 has you covered. -Ever single column gets a class attribute, which by default is the same -as the column's label. So every row of the ``SimpleTable()`` from previous -example will look like: +Also every column gets a class attribute, which by default is the same as the +column's label. Also, by default, odd rows' class is ``odd`` and even rows' +class is ``even``. So rows of the ``SimpleTable()`` from previous example +in django-tables2 default configuration will look like: .. sourcecode:: html - + - + + + + + + You can also specify ``attrs`` attribute when creating a column. django-tables2 supports 3 different dictionaries, this way you can give different attributes to column tags in table header (``th``), rows (``td``) or footer (``tf``) @@ -54,7 +59,7 @@ to column tags in table header (``th``), rows (``td``) or footer (``tf``) ... >>> table = SimpleTable() >>> # renders to something like this: - '' + '' >>> # and the footer will look like this: ' ... '' From 7820b55049ce6c1df995f83fc5b4f89453ef141d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 17 Nov 2017 16:16:45 +0100 Subject: [PATCH 10/15] Describe tf attribute in Column.attrs --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 106d891b..e6acb6b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - Added `as=varname` keyword argument to the `{% querystring %}` template tag, fixes [#481](https://github.com/jieter/django-tables2/issues/481) - Updated the tutorial to reflect current state of Django a bit better + - Added `tf` dictionary to `Column.attrs` with default values for the footer, + so footers now have `class` attribute by default ## 1.14.2 (2017-10-30) - Added a `row_counter` variable to the template context in `TemplateColumn` (fixes [#448](https://github.com/jieter/django-tables2/issues/488)) From 0a6144b5588d3f08c1fe293d5863550ee456ad65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 24 Nov 2017 09:14:44 +0100 Subject: [PATCH 11/15] Remove double space --- django_tables2/templates/django_tables2/semantic.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_tables2/templates/django_tables2/semantic.html b/django_tables2/templates/django_tables2/semantic.html index 92bc98c8..30beb141 100644 --- a/django_tables2/templates/django_tables2/semantic.html +++ b/django_tables2/templates/django_tables2/semantic.html @@ -43,7 +43,7 @@ {% if table.has_footer %} {% for column in table.columns %} - + {% endfor %} {% endif %} From 714c21339cf2106ea9d7b8a0ff79d5431c804f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 24 Nov 2017 09:27:26 +0100 Subject: [PATCH 12/15] Add cross-refs from css to column-attributes --- docs/pages/column-attributes.rst | 6 ++++-- docs/pages/custom-rendering.rst | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/pages/column-attributes.rst b/docs/pages/column-attributes.rst index d71a001d..5c19d14b 100644 --- a/docs/pages/column-attributes.rst +++ b/docs/pages/column-attributes.rst @@ -21,9 +21,11 @@ Depending on the column, different elements are supported, however ``th``, For ``th`` and ``td``, the column name will be added as a class name. This makes -selecting the row for styling easier. -Have a look at each column's API reference to find which elements are supported. +selecting the row for styling easier. Have a look at each column's API +reference to find which elements are supported. +If you need to add some extra attributes to column's tags rendered in the +footer, use key name ``tf``, as described in section on :ref:`css`. .. _row-attributes: diff --git a/docs/pages/custom-rendering.rst b/docs/pages/custom-rendering.rst index 2076ff86..8c9c3794 100644 --- a/docs/pages/custom-rendering.rst +++ b/docs/pages/custom-rendering.rst @@ -41,9 +41,11 @@ in django-tables2 default configuration will look like: - -You can also specify ``attrs`` attribute when creating a column. django-tables2 -supports 3 different dictionaries, this way you can give different attributes +You can also specify ``attrs`` attribute when creating a column. ``attrs`` +is a dictionary which contains attributes which by default get rendered +on various tags involved with rendering a column. You can read more about +them in :ref:`column-attributes`. django-tables2 supports 3 different +dictionaries, this way you can give different attributes to column tags in table header (``th``), rows (``td``) or footer (``tf``) .. sourcecode:: python @@ -54,9 +56,6 @@ to column tags in table header (``th``), rows (``td``) or footer (``tf``) ... id = tables.Column(attrs={'td': {'class': 'my-class'}}) ... age = tables.Column(attrs={'tf': {'bgcolor': 'red'}}) ... - ... class Meta: - ... attrs = {'class': 'mytable'} - ... >>> table = SimpleTable() >>> # renders to something like this: '' From 3394278dbf038b8f49ac6d80191d51255acb246b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 24 Nov 2017 10:03:08 +0100 Subject: [PATCH 13/15] Don't use BeautifulSoup4 for tests, use lxml which is being used already --- requirements/common.pip | 3 +-- tests/test_faq.py | 8 ++------ tests/test_footer.py | 27 +++++++-------------------- 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/requirements/common.pip b/requirements/common.pip index d006b080..9c1a8047 100644 --- a/requirements/common.pip +++ b/requirements/common.pip @@ -6,5 +6,4 @@ pytz>0 pytest pytest-django pytest-cov -tablib==0.11.4 -BeautifulSoup4 \ No newline at end of file +tablib==0.11.4 \ No newline at end of file diff --git a/tests/test_faq.py b/tests/test_faq.py index 95454528..08bbfb0b 100644 --- a/tests/test_faq.py +++ b/tests/test_faq.py @@ -1,9 +1,8 @@ import itertools import django_tables2 as tables -from bs4 import BeautifulSoup -from .utils import build_request +from .utils import build_request, parse TEST_DATA = [ {'name': 'Belgium', 'population': 11200000}, @@ -45,8 +44,5 @@ class CountryTable(tables.Table): table = CountryTable(TEST_DATA) html = table.as_html(build_request()) - soup = BeautifulSoup(html, "lxml") - row = soup.find("tfoot").tr - columns = row.find_all("td") - + columns = parse(html).findall(".//tfoot/tr")[-1].findall("td") assert columns[1].text == "Total: 77740000" diff --git a/tests/test_footer.py b/tests/test_footer.py index 32d48d0e..2dfad0f5 100644 --- a/tests/test_footer.py +++ b/tests/test_footer.py @@ -1,8 +1,7 @@ # coding: utf-8 import django_tables2 as tables -from bs4 import BeautifulSoup -from .utils import build_request +from .utils import build_request, parse MEMORY_DATA = [ {'name': 'Queensland', 'country': 'Australia', 'population': 4750500}, @@ -32,13 +31,9 @@ class Table(tables.Table): table = Table(MEMORY_DATA) assert table.has_footer() is True - html = table.as_html(build_request('/')) - soup = BeautifulSoup(html, "lxml") - row = soup.find("tfoot").tr - columns = row.find_all("td") - + columns = parse(html).findall(".//tfoot/tr")[-1].findall("td") assert columns[1].text == "Total:" assert columns[2].text == "18833000" @@ -70,10 +65,7 @@ class TestTable(tables.Table): table = TestTable(MEMORY_DATA) html = table.as_html(build_request('/')) - soup = BeautifulSoup(html, "lxml") - row = soup.find("tfoot").tr - columns = row.find_all("td") - + columns = parse(html).findall(".//tfoot/tr")[-1].findall("td") assert columns[1].text == "Total:" assert columns[2].text == "18833000" @@ -92,11 +84,8 @@ class TestTable(tables.Table): table = TestTable(MEMORY_DATA) html = table.as_html(build_request('/')) - soup = BeautifulSoup(html, "lxml") - row = soup.find("tfoot").tr - columns = row.find_all("td") - - assert "class" in columns[1].attrs + columns = parse(html).findall(".//tfoot/tr")[-1].findall("td") + assert "class" in columns[1].attrib def test_footer_custom_attriubtes(): @@ -114,7 +103,5 @@ class TestTable(tables.Table): table.columns['country'].attrs['tf'] = {'align': 'right'} html = table.as_html(build_request('/')) - soup = BeautifulSoup(html, "lxml") - row = soup.find("tfoot").tr - columns = row.find_all("td") - assert "align" in columns[1].attrs + columns = parse(html).findall(".//tfoot/tr")[-1].findall("td") + assert "align" in columns[1].attrib From 4e26343aaf970a41a82df3b7717eed46858f79a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 24 Nov 2017 10:07:27 +0100 Subject: [PATCH 14/15] isort --- tests/columns/test_datetimecolumn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/columns/test_datetimecolumn.py b/tests/columns/test_datetimecolumn.py index 2f005fc4..07089500 100644 --- a/tests/columns/test_datetimecolumn.py +++ b/tests/columns/test_datetimecolumn.py @@ -4,10 +4,10 @@ from datetime import datetime import pytest -import pytz from django.db import models import django_tables2 as tables +import pytz ''' From 0500b762e888f646ea340f20034fdbfa54149167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Fri, 24 Nov 2017 10:08:40 +0100 Subject: [PATCH 15/15] isort, again --- tests/columns/test_datetimecolumn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/columns/test_datetimecolumn.py b/tests/columns/test_datetimecolumn.py index 07089500..2f005fc4 100644 --- a/tests/columns/test_datetimecolumn.py +++ b/tests/columns/test_datetimecolumn.py @@ -4,10 +4,10 @@ from datetime import datetime import pytest +import pytz from django.db import models import django_tables2 as tables -import pytz '''
... ...
......
...
...
{{ column.footer }}{{ column.footer }}
...
...