Skip to content

Commit f35ed59

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 2e4b642 + 3ce64f9 commit f35ed59

File tree

17 files changed

+548
-244
lines changed

17 files changed

+548
-244
lines changed

.github/workflows/build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
flake8-linter:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- uses: grantmcconnaughey/lintly-flake8-github-action@v1.0
11+
if: github.event_name == 'pull_request'
12+
with:
13+
# The GitHub API token to create reviews with
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
# Fail if "new" violations detected or "any", default "new"
16+
failIf: any
17+
# Additional arguments to pass to flake8, default "." (current directory)
18+
args: "--extend-exclude=migrations ."
19+
build:
20+
runs-on: ubuntu-latest
21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
python-version: ['3.6', '3.7', '3.8']
25+
django-version: ['1.11', '2.0', '2.1', '2.2', '3.0']
26+
drf-version: ['3.9', '3.10', '3.11']
27+
include:
28+
- python-version: '2.7'
29+
django-version: '1.11'
30+
drf-version: '3.9'
31+
exclude:
32+
- django-version: '3.0'
33+
drf-version: '3.9'
34+
steps:
35+
- uses: actions/checkout@v2
36+
- name: Set up Python ${{ matrix.python-version }}
37+
uses: actions/setup-python@v1
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
- name: Install Dependencies
41+
run: |
42+
python -m pip install --upgrade pip
43+
echo "Python ${{ matrix.python-version }} -> Django ${{ matrix.django-version }} -> DRF ${{ matrix.drf-version }}"
44+
python -m pip install "Django~=${{ matrix.django-version }}.0"
45+
python -m pip install "djangorestframework~=${{ matrix.drf-version }}.0"
46+
echo "Django: `django-admin --version`"
47+
python --version
48+
- name: Run Tests
49+
run: |
50+
python example/manage.py test tests -v 1 --noinput

.github/workflows/codecov.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: codecov
2+
on: [push, pull_request]
3+
jobs:
4+
run:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@master
8+
- name: Setup Python
9+
uses: actions/setup-python@master
10+
with:
11+
python-version: 3.8
12+
- name: Generate coverage report
13+
run: |
14+
pip install -r requirements.txt
15+
pip install coverage
16+
pip install -q -e .
17+
coverage run example/manage.py test tests -v 1 --noinput
18+
coverage xml
19+
- name: Upload coverage to Codecov
20+
uses: codecov/codecov-action@v1
21+
with:
22+
token: ${{ secrets.CODECOV_TOKEN }}
23+
file: ./coverage.xml
24+
flags: unittests
25+
name: codecov-umbrella
26+
fail_ci_if_error: true
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
3+
name: Upload Python Package
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
deploy:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: '3.x'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install setuptools wheel twine
24+
- name: Build and publish
25+
env:
26+
TWINE_USERNAME: '__token__'
27+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
28+
run: |
29+
python setup.py sdist bdist_wheel
30+
twine upload --repository testpypi dist/*

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ dist/
1212
*.egg-info/
1313
MANIFEST
1414
docs/_build
15-
/.idea
15+
/.idea
16+
/venv*
17+
/env*

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,4 @@ If you want to check the coverage, use:
229229
.. |dj-versions| image:: https://img.shields.io/pypi/djversions/djangorestframework-datatables-editor.svg?style=flat-square
230230
:target: https://img.shields.io/pypi/djversions/djangorestframework-datatables-editor.svg
231231
:alt: Django versions
232+

docs/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
Version 0.3.3 (2020-05-17):
5+
---------------------------
6+
7+
- Added support for Django 3.0
8+
9+
410
Version 0.3.2 (2019-05-23):
511
---------------------------
612

example/__init__.py

Whitespace-only changes.

example/albums/views.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
from rest_framework.response import Response
44

55
from rest_framework_datatables_editor.filters import DatatablesFilterBackend
6-
from rest_framework_datatables_editor.pagination import DatatablesPageNumberPagination
7-
from rest_framework_datatables_editor.renderers import DatatablesRenderer
8-
from rest_framework_datatables_editor.viewsets import DatatablesEditorModelViewSet
6+
from rest_framework_datatables_editor.pagination import (
7+
DatatablesPageNumberPagination)
8+
from rest_framework_datatables_editor.renderers import (DatatablesRenderer)
9+
from rest_framework_datatables_editor.viewsets import (
10+
DatatablesEditorModelViewSet)
911
from .models import Album, Artist, Genre
1012
from .serializers import AlbumSerializer, ArtistSerializer
1113

@@ -16,8 +18,10 @@ def index(request):
1618

1719
def get_album_options():
1820
return "options", {
19-
"artist.id": [{'label': obj.name, 'value': obj.pk} for obj in Artist.objects.all()],
20-
"genre": [{'label': obj.name, 'value': obj.pk} for obj in Genre.objects.all()]
21+
"artist.id": [{'label': obj.name, 'value': obj.pk}
22+
for obj in Artist.objects.all()],
23+
"genre": [{'label': obj.name, 'value': obj.pk}
24+
for obj in Genre.objects.all()]
2125
}
2226

2327

example/example/settings.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,20 @@
6464
}
6565
}
6666

67+
validation = 'django.contrib.auth.password_validation'
68+
6769
AUTH_PASSWORD_VALIDATORS = [
6870
{
69-
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
71+
'NAME': '%s.UserAttributeSimilarityValidator' % validation,
7072
},
7173
{
72-
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
74+
'NAME': '%s.MinimumLengthValidator' % validation,
7375
},
7476
{
75-
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
77+
'NAME': '%s.CommonPasswordValidator' % validation,
7678
},
7779
{
78-
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
80+
'NAME': '%s.NumericPasswordValidator' % validation,
7981
},
8082
]
8183

@@ -105,6 +107,7 @@
105107
'DEFAULT_FILTER_BACKENDS': (
106108
'rest_framework_datatables_editor.filters.DatatablesFilterBackend',
107109
),
108-
'DEFAULT_PAGINATION_CLASS': 'rest_framework_datatables_editor.pagination.DatatablesPageNumberPagination',
110+
'DEFAULT_PAGINATION_CLASS': 'rest_framework_datatables_editor.pagination.'
111+
'DatatablesPageNumberPagination',
109112
'PAGE_SIZE': 50,
110113
}

0 commit comments

Comments
 (0)