Skip to content

Commit

Permalink
Version 1.2.0: Django 4+ Support
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanambra committed Nov 23, 2024
1 parent f58bbc3 commit 36c86eb
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ __pycache__/
*.py[cod]
*$py.class

# IDEs and editors
.idea

# C extensions
*.so

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 1.2.0
------------------------
* Add support for Django 4+


Version 1.1.9
------------------------
* Cleanup stray .pyc files
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
override:
- pip install tox tox-pyenv
- pyenv local 2.7.11 3.5.3 3.6.2
- pyenv local 3.7.17 3.8.20 3.9.20 3.10.15 3.11.10 3.12.7

test:
override:
Expand Down
12 changes: 6 additions & 6 deletions papertrail/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import itertools
import json

from django.conf.urls import url
from django.contrib import admin
from django.core import serializers
from django.db.models import Q
from django.shortcuts import get_object_or_404, render
from django.utils.encoding import force_text
from django.urls import re_path
from django.utils.encoding import force_str
from django.utils.html import format_html
from django.utils.text import capfirst
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

import papertrail
from papertrail.models import Entry, EntryRelatedObject
Expand Down Expand Up @@ -131,7 +131,7 @@ def get_urls(self):
info = self.model._meta.app_label, self.model._meta.model_name

urlpatterns = [
url(r'^(.+)/papertrail/', self.admin_site.admin_view(self.view_papertrail_item), name=u'{0}_{1}_papertrail'.format(*info)),
re_path(r'^(.+)/papertrail/', self.admin_site.admin_view(self.view_papertrail_item), name=u'{0}_{1}_papertrail'.format(*info)),
] + super(AdminEventLoggerMixin, self).get_urls()

return urlpatterns
Expand Down Expand Up @@ -173,15 +173,15 @@ def view_papertrail(self, request, queryset, extra_context=None):

if queryset.count() == 1:
obj = queryset[0]
title = _('Paper Trail: %s') % force_text(obj)
title = _('Paper Trail: %s') % force_str(obj)
else:
obj = None
title = _('Paper Trail: %s %s') % (queryset.count(), opts.verbose_name_plural)

context = {
'title': title,
'action_list': action_list,
'module_name': capfirst(force_text(opts.verbose_name_plural)),
'module_name': capfirst(force_str(opts.verbose_name_plural)),
'app_label': app_label,
'opts': opts,
'object': obj,
Expand Down
21 changes: 10 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@

setup(
name='django-papertrail',
version='1.1.9',
version='1.2.0',
packages=['papertrail'],
install_requires=[
'Django>=1.10,<2.0;python_version<"3.0"',
'Django>=1.10;python_version>"3.0"',
'six',
'Django>=4.0',
'django-apptemplates',
],
include_package_data=True,
Expand All @@ -28,18 +26,19 @@
'Environment :: Web Environment',
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 4.0',
'Framework :: Django :: 5.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software 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.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Database',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
Expand Down
22 changes: 11 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
[tox]
envlist =
py{27,35,36}-django110,
py{27,35,36}-django111,
py36-django200,
py{37,38,39,310,311,312}-django{400,500},
flake8,
isort

[testenv]
basepython =
py27: python2.7
py35: python3.5
py36: python3.6
py37: python3.7
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
commands = make test
deps =
psycopg2
django-jsonfield
django110: Django>=1.10,<1.11
django11: Django>=1.11,<1.12
django200: Django>=2.0,<2.1
django400: Django>=4.0,<5.0
django500: Django>=5.0,<6.0
setenv =
PYTHONPATH = {toxinidir}
whitelist_externals = make

[testenv:flake8]
basepython =
python2.7
python3.12
commands = make flake8
deps =
flake8

[testenv:isort]
basepython =
python2.7
python3.12
commands = make isort_check_only
deps =
isort

0 comments on commit 36c86eb

Please sign in to comment.