Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: build

on: [push, pull_request]

jobs:
flake8-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: grantmcconnaughey/lintly-flake8-github-action@v1.0
if: github.event_name == 'pull_request'
with:
# The GitHub API token to create reviews with
token: ${{ secrets.GITHUB_TOKEN }}
# Fail if "new" violations detected or "any", default "new"
failIf: any
# Additional arguments to pass to flake8, default "." (current directory)
args: "--extend-exclude=migrations ."
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ['3.6', '3.7', '3.8']
django-version: ['1.11', '2.0', '2.1', '2.2', '3.0']
drf-version: ['3.9', '3.10', '3.11']
include:
- python-version: '2.7'
django-version: '1.11'
drf-version: '3.9'
exclude:
- django-version: '3.0'
drf-version: '3.9'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
echo "Python ${{ matrix.python-version }} -> Django ${{ matrix.django-version }} -> DRF ${{ matrix.drf-version }}"
python -m pip install "Django~=${{ matrix.django-version }}.0"
python -m pip install "djangorestframework~=${{ matrix.drf-version }}.0"
echo "Django: `django-admin --version`"
python --version
- name: Run Tests
run: |
python example/manage.py test tests -v 1 --noinput
26 changes: 26 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: codecov
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.8
- name: Generate coverage report
run: |
pip install -r requirements.txt
pip install coverage
pip install -q -e .
coverage run example/manage.py test tests -v 1 --noinput
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
30 changes: 30 additions & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will upload a Python Package using Twine when a release is created

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload --repository testpypi dist/*
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ dist/
*.egg-info/
MANIFEST
docs/_build
/.idea
/.idea
/venv*
/env*
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

17 changes: 9 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
django-rest-framework-datatables-editor
=======================================

|build-status-image| |codecov-image| |documentation-status-image| |pypi-version| |py-versions|
|build-status-image| |codecov-image| |documentation-status-image| |pypi-version| |py-versions| |dj-versions|

Overview
--------
Expand Down Expand Up @@ -212,21 +212,22 @@ If you want to check the coverage, use:
:target: https://travis-ci.com/VVyacheslav/django-rest-framework-datatables-editor
:alt: Travis build

.. |codecov-image| image:: https://codecov.io/gh/VVyacheslav/django-rest-framework-datatables-editor/branch/master/graph/badge.svg
.. |codecov-image| image:: https://codecov.io/gh/VVyacheslav/django-rest-framework-datatables-editor/branch/master/graph/badge.svg?style=flat-square
:target: https://codecov.io/gh/VVyacheslav/django-rest-framework-datatables-editor

.. |pypi-version| image:: https://img.shields.io/pypi/v/djangorestframework-datatables-editor.svg
.. |pypi-version| image:: https://img.shields.io/pypi/v/djangorestframework-datatables-editor.svg?style=flat-square
:target: https://pypi.python.org/pypi/djangorestframework-datatables-editor
:alt: Pypi version

.. |documentation-status-image| image:: https://readthedocs.org/projects/drf-datatables-editor/badge/?version=latest
.. |documentation-status-image| image:: https://readthedocs.org/projects/drf-datatables-editor/badge/?version=latest&style=flat-square
:target: https://drf-datatables-editor.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. |py-versions| image:: https://img.shields.io/pypi/pyversions/djangorestframework-datatables-editor.svg
:target: https://img.shields.io/pypi/pyversions/djangorestframework-datatables.svg
.. |py-versions| image:: https://img.shields.io/pypi/pyversions/djangorestframework-datatables-editor.svg?style=flat-square
:target: https://img.shields.io/pypi/pyversions/djangorestframework-datatables-editor.svg
:alt: Python versions

.. |dj-versions| image:: https://img.shields.io/pypi/djversions/djangorestframework-datatables.svg
:target: https://img.shields.io/pypi/djversions/djangorestframework-datatables.svg
.. |dj-versions| image:: https://img.shields.io/pypi/djversions/djangorestframework-datatables-editor.svg?style=flat-square
:target: https://img.shields.io/pypi/djversions/djangorestframework-datatables-editor.svg
:alt: Django versions

6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

Version 0.3.3 (2020-05-17):
---------------------------

- Added support for Django 3.0


Version 0.3.2 (2019-05-23):
---------------------------

Expand Down
Empty file added example/__init__.py
Empty file.
14 changes: 9 additions & 5 deletions example/albums/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
from rest_framework.response import Response

from rest_framework_datatables_editor.filters import DatatablesFilterBackend
from rest_framework_datatables_editor.pagination import DatatablesPageNumberPagination
from rest_framework_datatables_editor.renderers import DatatablesRenderer
from rest_framework_datatables_editor.viewsets import DatatablesEditorModelViewSet
from rest_framework_datatables_editor.pagination import (
DatatablesPageNumberPagination)
from rest_framework_datatables_editor.renderers import (DatatablesRenderer)
from rest_framework_datatables_editor.viewsets import (
DatatablesEditorModelViewSet)
from .models import Album, Artist, Genre
from .serializers import AlbumSerializer, ArtistSerializer

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

def get_album_options():
return "options", {
"artist.id": [{'label': obj.name, 'value': obj.pk} for obj in Artist.objects.all()],
"genre": [{'label': obj.name, 'value': obj.pk} for obj in Genre.objects.all()]
"artist.id": [{'label': obj.name, 'value': obj.pk}
for obj in Artist.objects.all()],
"genre": [{'label': obj.name, 'value': obj.pk}
for obj in Genre.objects.all()]
}


Expand Down
13 changes: 8 additions & 5 deletions example/example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,20 @@
}
}

validation = 'django.contrib.auth.password_validation'

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
'NAME': '%s.UserAttributeSimilarityValidator' % validation,
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'NAME': '%s.MinimumLengthValidator' % validation,
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
'NAME': '%s.CommonPasswordValidator' % validation,
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
'NAME': '%s.NumericPasswordValidator' % validation,
},
]

Expand Down Expand Up @@ -105,6 +107,7 @@
'DEFAULT_FILTER_BACKENDS': (
'rest_framework_datatables_editor.filters.DatatablesFilterBackend',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework_datatables_editor.pagination.DatatablesPageNumberPagination',
'DEFAULT_PAGINATION_CLASS': 'rest_framework_datatables_editor.pagination.'
'DatatablesPageNumberPagination',
'PAGE_SIZE': 50,
}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
django>=1.9
djangorestframework>=3.9.1
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[wheel]
universal = 1
[flake8]
per-file-ignores = tests/test_api.py: E501
Loading