Skip to content

Commit

Permalink
Merge pull request #3 from utapyngo/django30
Browse files Browse the repository at this point in the history
  • Loading branch information
utapyngo authored Jul 6, 2020
2 parents 136c91b + 0759608 commit a35dd36
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: test
on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --upgrade pip
- run: python -m pip install "Django~=${{ matrix.django-version }}.0"
- run: python -m pip install python-dateutil>=2.1
- run: python datatableview/tests/example_project/manage.py test
strategy:
max-parallel: 4
matrix:
python-version:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
django-version:
- "2.2"
- "3.0"
exclude:
- python-version: "3.5"
django-version: "3.0"
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions datatableview/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Manager, Model, Q
from django.http import HttpResponse, HttpResponseBadRequest
from django.utils.encoding import force_text
from django.utils.encoding import force_str
from django.utils.text import smart_split
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.generic.list import ListView, MultipleObjectMixin
Expand Down Expand Up @@ -492,11 +492,11 @@ def _get_resolver_method(self, i, column):
return True, getattr(self, callback)

# Treat the 'nice name' as the starting point for looking up a method
name = force_text(column.pretty_name, errors="ignore")
name = force_str(column.pretty_name, errors="ignore")
if not name:
name = column.fields[0]

mangled_name = re.sub(r'[\W_]+', '_', force_text(name))
mangled_name = re.sub(r'[\W_]+', '_', force_str(name))

f = getattr(self, 'get_column_%s_data' % mangled_name, None)
if f:
Expand Down

0 comments on commit a35dd36

Please sign in to comment.