From 1f1ddae42ca22d8ddc739b7bc708b7899987dc11 Mon Sep 17 00:00:00 2001 From: arielkru <63583491+arielkru@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:58:40 +0200 Subject: [PATCH] Update django.py --- python/django.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/django.py b/python/django.py index 3beac97..cdd05eb 100644 --- a/python/django.py +++ b/python/django.py @@ -2,12 +2,14 @@ from collections import OrderedDict from django.conf import settings + try: from django.core import urlresolvers except ImportError: from django import urls as urlresolvers try: from django.urls.exceptions import NoReverseMatch + except ImportError: from django.core.urlresolvers import NoReverseMatch from django.utils.html import format_html @@ -16,10 +18,12 @@ MAX = 75 + class LogEntryAdminMixin(object): def created(self, obj): return obj.timestamp.strftime('%Y-%m-%d %H:%M:%S') + created.short_description = 'Created' def user_url(self, obj): @@ -40,6 +44,7 @@ def msg_short(self, obj): return '' # delete changes = json.loads(obj.changes) s = '' if len(changes) == 1 else 's' + fields = ', '.join(changes.keys()) if len(fields) > MAX: i = fields.rfind(' ', 0, MAX) @@ -52,6 +57,7 @@ def msg(self, obj): return '' # delete changes = json.loads(obj.changes) msg = '
# | Field | From | To |
---|---|---|---|
{} | {} | {} | {} |