Skip to content

Commit

Permalink
Merge pull request #99 from imomaliev/django3
Browse files Browse the repository at this point in the history
django 3.0 and python 3.8
  • Loading branch information
ticosax authored Mar 26, 2020
2 parents 355cb22 + 84f424c commit adbee74
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 49 deletions.
44 changes: 10 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,17 @@
dist: xenial
language: python
sudo: false
cache: pip

matrix:
include:
- env: TOXENV=py27-dj-1.8
python: 2.7
- env: TOXENV=py27-dj-1.11
python: 2.7
- env: TOXENV=py34-dj-1.8
python: 3.4
- env: TOXENV=py34-dj-1.11
python: 3.4
- env: TOXENV=py35-dj-1.8
python: 3.5
- env: TOXENV=py35-dj-1.11
python: 3.5
- env: TOXENV=py36-dj-1.8
python: 3.6
- env: TOXENV=py36-dj-1.11
python: 3.6
- env: TOXENV=py34-dj-2.0
python: 3.4
- env: TOXENV=py35-dj-2.0
python: 3.5
- env: TOXENV=py36-dj-2.0
python: 3.6
- env: TOXENV=py36-dj-2.1
python: 3.6
- env: TOXENV=py36-dj-master
python: 3.6
- env: TOXENV=flake8
python: 3.6
allow_failures:
- env: TOXENV=py36-dj-master
python: 3.6
python:
- 3.4
- 3.5
- 3.6
- 3.7
- 3.8

install:
- pip install tox codecov
- pip install tox tox-travis codecov

script: tox

Expand Down
6 changes: 2 additions & 4 deletions django_fsm_log/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.timezone import now
from django_fsm import FSMFieldMixin, FSMIntegerField

from .conf import settings
from .managers import StateLogManager


@python_2_unicode_compatible
class StateLog(models.Model):
timestamp = models.DateTimeField(default=now)
by = models.ForeignKey(getattr(settings, 'AUTH_USER_MODEL', 'auth.User'), blank=True,
Expand Down Expand Up @@ -46,10 +44,10 @@ def get_state_display(self, field_name='state'):
state = getattr(self, field_name)
if isinstance(field, FSMIntegerField):
state_display = dict(field.flatchoices).get(int(state), state)
return force_text(state_display, strings_only=True)
return str(state_display)
elif isinstance(field, FSMFieldMixin):
state_display = dict(field.flatchoices).get(state, state)
return force_text(state_display, strings_only=True)
return str(state_display)

def get_source_state_display(self):
return self.get_state_display('source_state')
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def readfile(filename):

setup(
name='django-fsm-log',
version='1.6.2',
version='1.7.0',
description='Logging for django-fsm',
long_description=readfile('README.md'),
long_description_content_type='text/markdown',
Expand All @@ -32,21 +32,20 @@ def readfile(filename):
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development :: Libraries :: Python Modules',
]
)
13 changes: 8 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
[tox]
envlist =
py{27,34,35,36}-dj-{1.8,1.11}
py{34,35,36}-dj-2.0
py{35,36}-dj-master
py{34,35,36,37}-dj-1.11
py{34,35,36,37}-dj-2.0
py{35,36,37,38}-dj-2.{1,2}
py{36,37,38}-dj-3.0
py{36,37,38}-dj-master
flake8

[testenv]
usedevelop = true
commands = pytest --cov=django_fsm_log --cov=tests {posargs}
extras = testing
deps =
dj-1.8: Django>=1.8,<1.9
dj-1.11: Django>=1.11,<2.0
dj-2.0: Django>=2.0,<2.1
dj-2.1: Django>=2.1,<2.2
dj-2.2: Django>=2.2,<3.0
dj-3.0: Django>=3.0,<3.1
dj-master: https://github.com/django/django/archive/master.tar.gz

[testenv:flake8]
basepython = python3.6
basepython = python3.8
commands = flake8 django_fsm_log tests
extras =
deps =
Expand Down

0 comments on commit adbee74

Please sign in to comment.