Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
7717d10
chore: update url
cirotix Nov 26, 2019
d083ae3
briefme version
cirotix Nov 26, 2019
7e065db
remove idea
cirotix Nov 26, 2019
2ff497b
chore(): release version 0.1.0
cirotix Nov 26, 2019
3df8304
feat: add h6
cirotix Nov 26, 2019
a37730a
fix: remove brief.me specific
cirotix Nov 26, 2019
289408e
style: blacken
cirotix Nov 26, 2019
b892194
chore(setup): add django dependency
cirotix Nov 26, 2019
0e2ea03
clean: remove unused tlds
cirotix Nov 26, 2019
ca86356
clean: remove unecessary encoding in Python3
cirotix Nov 26, 2019
6da94cb
refactor: move _typographie and rename
cirotix Nov 26, 2019
91b0680
refactor: use a plugin based architecture
cirotix Nov 26, 2019
74bf1bb
Bump to version 0.2.0
cirotix Nov 26, 2019
b7e963b
fix: import django later
cirotix Nov 26, 2019
2faae67
style: black
cirotix Nov 27, 2019
e257b5e
chore: add apps.py
cirotix Nov 28, 2019
6f767ed
feat(admin): provide an Admin class
cirotix Nov 28, 2019
85a253b
bump to version 0.3.0
cirotix Nov 28, 2019
2cd1eca
feat: add brief.me filter
cirotix Nov 28, 2019
8126f1c
bump to version 0.3.1
cirotix Nov 28, 2019
c41f19b
chore(): add file and folder to .gitignore
ThomSawyer Dec 3, 2019
37d89ad
prune(): remove tests.py file
ThomSawyer Dec 3, 2019
5253d5a
prune(): remove shebang line
ThomSawyer Dec 3, 2019
2571a9d
test(): replace spaces by typographie
ThomSawyer Dec 3, 2019
85ebfe6
chore(): add Makefile
ThomSawyer Dec 3, 2019
0aa451f
feat(): add test_requirements.txt
ThomSawyer Dec 3, 2019
86fee63
chore(): add .travis.yml file
ThomSawyer Dec 3, 2019
202ef27
chore(): add file and folder to .gitignore
ThomSawyer Dec 3, 2019
bbbd335
doc(): add badges
ThomSawyer Dec 3, 2019
4e4c5d8
style(): blacken
ThomSawyer Dec 3, 2019
edbea35
test(): fix quotation_ark_with_perdiod
cirotix Dec 12, 2019
8039def
test(): test quotation mark remplacement
cirotix Dec 12, 2019
21cf0cb
feat(): filter exponent
cirotix Dec 12, 2019
a4401b2
feat(): filter indice
cirotix Dec 12, 2019
07eeaf3
test(): narrow test targets
cirotix Dec 12, 2019
66e75b2
hotfix(filters): remove exponent filter
cirotix Dec 20, 2019
c382a8d
bump to version 0.4.1
cirotix Dec 20, 2019
fa2355c
fix(): fix package name in setup.py
ThomSawyer Jan 30, 2020
b5bcdd0
feat(): release version 0.4.2
ThomSawyer Jan 30, 2020
a9d9445
feat(admin): catch KeyError exception
ThomSawyer Feb 10, 2020
16568cd
feat(): release version 0.4.3
ThomSawyer Feb 10, 2020
465277e
feat: handle list of strings in a JSON field
souen Mar 2, 2020
b92b89c
feat: bump to version 0.4.4
souen Mar 2, 2020
a82ab9f
Merge pull request #1 from briefmnews/json-field-flat-list
souen Mar 2, 2020
84db0cd
feat(): add metric filer
ThomSawyer May 18, 2020
95a5dcb
feat(): update exponent filter
ThomSawyer May 18, 2020
e843a98
fix(): update filters
ThomSawyer May 19, 2020
85186ce
test(): add and fix tests for exponent and metric
ThomSawyer May 19, 2020
8a68609
feat(): add exponent for numbers between 1 and 999
ThomSawyer May 19, 2020
8f46e95
feat(): release version 0.4.5
ThomSawyer May 19, 2020
59e4a3e
feat(): add support for comma in exponent, indice and metric filter
ThomSawyer May 19, 2020
129eda3
feat(): release version 0.4.6
ThomSawyer May 19, 2020
81de5e6
refactor(): simplify exponent filter for roman numerals
ThomSawyer May 20, 2020
052f29c
feat(): release version 0.4.7
ThomSawyer May 20, 2020
b6fde29
fix(filters): update regex for roman numerals
ThomSawyer May 27, 2020
8296b67
test(filters): add test
ThomSawyer May 27, 2020
3b2f418
feat(): release version 0.4.8
ThomSawyer May 27, 2020
21a1a52
chore: setup test with github action
ThomSawyer May 29, 2020
552f7f1
doc: update README.md file
ThomSawyer May 29, 2020
dc0c19a
doc: add codecov badge to README.md
ThomSawyer May 29, 2020
886401c
doc: Python CI badge send to Python CI github UI
ThomSawyer May 29, 2020
1535ee7
chore: rename django.yml to workflow.yml
ThomSawyer May 29, 2020
9393730
chore: remove .travis.yaml
ThomSawyer May 29, 2020
09fb7e1
chore: add codecov to Python CI
ThomSawyer May 29, 2020
e83c718
feat: improve typo filter
ThomSawyer Jun 24, 2020
b4d1a5e
test: add tests
ThomSawyer Jun 24, 2020
a8313d9
feat: relase version 0.4.9
ThomSawyer Jun 24, 2020
3dec4e3
feat(black): add package
ThomSawyer Aug 26, 2020
2d8098b
fix(filters): do not hardcode Brief.me a link color
ThomSawyer Aug 26, 2020
7611b7d
feat: release version 0.4.10
ThomSawyer Aug 26, 2020
349dcb2
feat: update test_requirements.txt
ThomSawyer Sep 10, 2020
ed40371
feat(filter): handle Brief.me with zero width space instead of a tag
ThomSawyer Sep 10, 2020
a3fa597
feat: release version 0.4.11
ThomSawyer Sep 10, 2020
a76afd5
fix: add secrets.CODECOV_TOKEN to ci
ThomSawyer Sep 10, 2020
4a0242f
prune: do not fail ci if codecoverage won't upload
ThomSawyer Sep 10, 2020
53a07d8
fix: add ZERO WIDTH NON-JOINER character between Brief.me letters
ThomSawyer Sep 14, 2020
87ef119
feat: release version 0.4.12
ThomSawyer Sep 14, 2020
2cc47b0
refactor: exponents for arabic and roman numerals are handled in cb_r…
ThomSawyer Mar 3, 2021
598493e
style: blacken
ThomSawyer Mar 3, 2021
fd58535
feat: release version 0.5.0
ThomSawyer Mar 3, 2021
1ce5005
refactor: indices are handled in cb_re_content_between_tags
ThomSawyer Mar 3, 2021
e014ca9
refactor: metric are handled in cb_re_content_between_tags
ThomSawyer Mar 3, 2021
894e2d8
feat: release version 0.6.0
ThomSawyer Mar 3, 2021
52ccbad
feat: add and fix rules
ThomSawyer Mar 24, 2021
7ea6077
test: add and fix tests
ThomSawyer Mar 24, 2021
0555de9
refactor: remove replace in spaces filter
ThomSawyer Mar 24, 2021
fd55b87
feat(ipdb): add ipdb to requirements.txt
ThomSawyer Mar 26, 2021
054c72d
refactor: update smartypants to handle nested quotes
ThomSawyer Mar 26, 2021
e1c3ced
test: add real worl examples for tests
ThomSawyer Mar 26, 2021
587feb3
test: add real world example
ThomSawyer Mar 26, 2021
9779277
feat: release version 0.7.0
ThomSawyer Mar 26, 2021
7214d31
feat: add prevent underline feature
ThomSawyer Apr 27, 2021
9b4f66e
test: add tests for prevent underline feature
ThomSawyer Apr 27, 2021
2223084
feat: release version 0.8.0
ThomSawyer Apr 27, 2021
82057a9
feat: add Arte.tv to re_prevent_underline
ThomSawyer May 4, 2021
167f6db
test: add test for Arte.tv
ThomSawyer May 4, 2021
d8e1bef
feat: release version 0.9.0
ThomSawyer May 4, 2021
4229128
chore: drop support for python 3.6 and add support for 3.9
ThomSawyer May 19, 2021
e0908cf
feat: extended specific words list
ThomSawyer May 25, 2021
8552f1a
feat: release version 0.10.0
ThomSawyer May 25, 2021
a8101b5
feat: add CH4 -> CH<sub>4</sub>
ThomSawyer Nov 29, 2021
44edfec
chore: release version 0.11.0
ThomSawyer Nov 29, 2021
68695b2
feat: add cybermalveillance.gouv.fr to re_prevent_underline
ThomSawyer Apr 7, 2022
e8a747d
style: blacken
ThomSawyer Apr 7, 2022
591e006
chore: release version 0.12.0
ThomSawyer Apr 7, 2022
c6221bc
chore: add release.yml github action
ThomSawyer Apr 7, 2022
a88328c
chore: update dependencies and remove python version 3.7 and 3.8
ThomSawyer Apr 7, 2022
427fc74
docs(readme): update python version badge
ThomSawyer Apr 7, 2022
2cb6fa9
chore: release version 0.12.1
ThomSawyer Apr 7, 2022
aeabcaf
feat(filters): add mangerbouger.fr
ThomSawyer Apr 21, 2022
10505ae
chore: release version 0.13.0
ThomSawyer Apr 21, 2022
03ab7cb
chore: install_requires Django 3.0 for minimum
Sep 29, 2022
8de1143
chore: bumps test_requirements
Sep 29, 2022
c1a32e3
refactor: replace force_text by force_str
Sep 29, 2022
695cfc7
feat: add Nord Stream 1 and 2 to specific word
Sep 29, 2022
4a9dd05
test: add tests for Nord Stream 1 and 2
Sep 29, 2022
f6fb42c
chore: release version 0.14.0
Sep 29, 2022
2e8b018
feat(admin): provide a response_change that handles _save_with_typo
souen Dec 5, 2022
89f1062
refactor(admin): apply typographie in save_related()
souen Dec 5, 2022
3cc0900
chore: release version 0.15.1
souen Dec 5, 2022
1b9818f
refactor(typographie): explicitely redirect to change view after save
souen Dec 6, 2022
17c2fc3
chore: release version 0.16.0
souen Dec 6, 2022
4940971
refactor: django.conf.urls is deprecated
Apr 5, 2023
1e7acf4
chore(.gitignore): add .egg-info
Apr 5, 2023
7ebbc6a
chore: release version 0.17.0
Apr 5, 2023
36726df
feat: add li to widont_finder
Apr 17, 2023
ad6cdcb
test: add test for non breaking space li
Apr 17, 2023
b7b1578
chore(test_requirements): bumps packages
Apr 17, 2023
f724658
chore: run black ./
Apr 17, 2023
0d576f6
chore: release version 0.18.0
Apr 17, 2023
b5f9c6c
fix: add ul to re_parse_content
Apr 17, 2023
239247d
test: add test for ul in re_parse_content
Apr 17, 2023
09aba89
chore: release version 0.18.1
Apr 17, 2023
15c3c7d
feat: add H2O to re_subscript
Aug 25, 2023
961c8e2
test: add test for H2O
Aug 25, 2023
dbf28fc
chore: releaser version 0.19.0
Aug 25, 2023
bf43955
feat(forms): create TypographieFilterForm #239
HortenseLaclaviere Jan 25, 2024
5f1d7cc
feat(templates): create html template for typographie filter #239
HortenseLaclaviere Jan 25, 2024
2589275
feat(view): add view to TypographieFilter #239
HortenseLaclaviere Jan 25, 2024
a395ecd
feat(urls): add url typographie #239
HortenseLaclaviere Jan 25, 2024
aa782c7
chore: release version 0.20.0
HortenseLaclaviere Jan 29, 2024
b5e9332
feat(manifest): add manifest file
HortenseLaclaviere Jan 29, 2024
5b1346f
chore: release version 0.21.0
HortenseLaclaviere Jan 29, 2024
479f477
feat(setup): add include_package_data
HortenseLaclaviere Jan 29, 2024
9677d5f
chore: release version 0.22.0
HortenseLaclaviere Jan 29, 2024
1cf103c
docs(readme): update python and Dango version
Dec 9, 2024
b062f42
chore: update python version nd Django version
Dec 9, 2024
8da53bb
feat: add brief.eco and brief.science
Dec 9, 2024
43854fc
test: add Brief.eco and Brief.science to test
Dec 9, 2024
c7229e4
chore: release version 0.23.0
Dec 9, 2024
26bd12d
fix: add Zero-width non-joiner support in re_exponent
Jan 28, 2025
1b7c69d
chore: release version 0.24.0
Jan 28, 2025
34fd025
feat: add non breaking space between J. D. initials
Mar 10, 2025
b1c908b
fix: remove redundent zero-width joiner space
Mar 12, 2025
96dc1bf
test: fix tests and add new test for J. D. Vance
Mar 12, 2025
a8b4cd9
chore: release version 0.25.0
Mar 12, 2025
6479258
feat(filters): Add Sapin II non-breaking space rule to filters
mlemaybrief Apr 14, 2025
cc71c05
chore(typographie): bumps from version 0.25.0 to version 0.26.0
mlemaybrief Apr 14, 2025
6d885ae
Revert "chore(typographie): bumps from version 0.25.0 to version 0.26.0"
mlemaybrief Apr 14, 2025
63e3ed5
chore: release version 0.26.0
mlemaybrief Apr 14, 2025
b8483b7
fix: replace &zwnj; with \xa0 in re_exponent
May 9, 2025
f5e2c79
test: fix tests
May 9, 2025
a221f33
chore: release version 0.27.0
May 9, 2025
8b8918c
feat(typographie): add non-breaking space before dash rule
HortenseLaclaviere Aug 13, 2025
7baf8c8
chore: release version 0.28.0
HortenseLaclaviere Aug 14, 2025
f4d50a5
feat: handle list in apply_typographie
Sep 19, 2025
97f0162
chore: bumps Django min version to 4.2
Sep 19, 2025
31c9a4d
chore: release version 0.29.0
Sep 19, 2025
62529a0
fix(admin): preserve null values in apply_typographie_to_dict
Jun 30, 2026
b7070fc
chore: release version 0.29.1
Jun 30, 2026
0d25b04
chore(setup.py): update install_requires with Django 5.2
Jun 30, 2026
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
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 2

steps:
- uses: actions/checkout@v2
- name: Create release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
34 changes: 34 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Python CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.11]

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
pip install -r test_requirements.txt
- name: Run Tests and generate coverage report
run: |
py.test --cov=typographie --cov-report=xml typographie/tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.7
with:
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
*.pot
*.pyc
local_settings.py
.idea
.python-version
.pytest_cache
.coverage
htmlcov
*.egg-info
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include typographie/templates *
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
install:
pip install -r test_requirements.txt

test:
py.test

coverage:
py.test --cov=typographie typographie/tests

report:
py.test --cov=typographie --cov-report=html typographie/tests

release:
git tag -a $(shell python -c "from typographie import __version__; print(__version__)") -m "$(m)"
git push origin --tags
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
django-typographie
==================
[![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3110/)
[![Django 5.2](https://img.shields.io/badge/django-5.2-blue.svg)](https://docs.djangoproject.com/en/4.2/)
[![Python CI](https://github.com/briefmnews/django-typographie/workflows/Python%20CI/badge.svg)](https://github.com/briefmnews/django-typographie/actions?query=workflow%3A%22Python+CI%22)
[![codecov](https://codecov.io/gh/briefmnews/django-typographie/branch/master/graph/badge.svg)](https://codecov.io/gh/briefmnews/django-typographie)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)

Un équivalent de typogrify pour le français.

django-typographie contient une version modifiée de smartypants (Jeff Schenck, https://github.com/jeffschenck/python-smartypants), ainsi que la méthode widont provenant de django-typogrify (Chris Drackett, https://github.com/chrisdrackett/django-typogrify).

#Exemple
# Exemple
*Extrait de « L’avenir d'une illusion », Sigmund Freud (traduction Marie Bonaparte)*

##Source :
## Source :
(...)La deuxième tentative est celle de la philosophie du "Comme si".Elle nous l'expose:nous admettons à figurer parmi nos processus cogitatifs toutes sortes d'hypothèses dont l'absence de fondement, voire l'absurdité, nous apparaît clairement.( ... ) Quand on racontait à mes enfants un conte de fées,qu'ils écoutaient avec recueillement,lui s'avançait et demandait: «Est-ce une histoire vraie?» Après qu'on lui avait dit que non,il s'éloignait d'un air méprisant . On peut s'attendre à ce que les hommes se comportent bientôt de même envers les contes de fées de la religion,en dépit de l'intercession du "Comme si".

##Résultat :
## Résultat :
(…) La deuxième tentative est celle de la philosophie du « Comme si ». Elle nous l’expose : nous admettons à figurer parmi nos processus cogitatifs toutes sortes d’hypothèses dont l’absence de fondement, voire l’absurdité, nous apparaît clairement. (…) Quand on racontait à mes enfants un conte de fées, qu’ils écoutaient avec recueillement, lui s’avançait et demandait : « Est-ce une histoire vraie ? » Après qu’on lui avait dit que non, il s’éloignait d’un air méprisant. On peut s’attendre à ce que les hommes se comportent bientôt de même envers les contes de fées de la religion, en dépit de l’intercession du « Comme si ».

*Espaces insécables invisibles mais correctement positionnées.*
*Espaces insécables invisibles mais correctement positionnées.*
35 changes: 19 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
#!/usr/bin/env python
from setuptools import setup, find_packages

import typographie

CLASSIFIERS = [
'Intended Audience :: Developers',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python'
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
]

KEYWORDS = 'django typogrify french français règles typographiques'
KEYWORDS = "django typogrify french français règles typographiques"


setup(name = 'typographie',
version = typographie.__version__,
description = """Apply french typografy rules""",
author = typographie.__author__,
url = "https://github.com/oxys-net/django-typographie",
packages = find_packages(),
classifiers = CLASSIFIERS,
keywords = KEYWORDS,
zip_safe = True
)
setup(
name="django-typographie",
version=typographie.__version__,
description="""Apply french typografy rules""",
author=typographie.__author__,
url="https://github.com/briefmnews/django-typographie",
packages=find_packages(),
classifiers=CLASSIFIERS,
keywords=KEYWORDS,
zip_safe=True,
python_requires=">=3.11",
install_requires=["Django>=5.2"],
include_package_data=True,
)
5 changes: 5 additions & 0 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
black==23.3.0
Django==4.2.24
ipdb==0.13.13
pytest==7.3.1
pytest-cov==4.0.0
6 changes: 4 additions & 2 deletions typographie/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__version__ = '0.0.2'
__author__ = 'OXYS.net'
from . import filters

__version__ = "0.29.1"
__author__ = "OXYS.net / Brief.me"
146 changes: 146 additions & 0 deletions typographie/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
from functools import update_wrapper
from urllib.parse import quote as urlquote

from django.contrib import admin, messages
from django.contrib.admin.utils import unquote
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist
from django.db import models
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, redirect
from django.urls import reverse
from django.utils.html import format_html

from typographie.typographie import typographie


def apply_typographie_to_dict(d, fields):
new_dict = {}
for k, v in d.items():
if isinstance(v, dict):
new_dict[k] = apply_typographie_to_dict(v, fields)
elif isinstance(v, list):
new_dict[k] = []
for i in v:
if not i:
new_dict[k].append(None)
elif isinstance(i, str):
if k in fields:
i = typographie(i)
new_dict[k].append(i)
else:
new_dict[k].append(apply_typographie_to_dict(i, fields))
else:
if k in fields and v:
v = typographie(v)
new_dict[k] = v
return new_dict


def apply_typographie(obj):
for field_name in obj.typographie_fields:
try:
field = getattr(obj, field_name)
except ObjectDoesNotExist:
continue

if isinstance(field, str):
setattr(obj, field_name, typographie(field))

#  This is probably a JSONField
elif isinstance(field, dict):
try:
fields = getattr(obj, f"get_typographie_{field_name}_fields")()
except (AttributeError, KeyError):
continue
setattr(obj, field_name, apply_typographie_to_dict(field, fields))

elif isinstance(field, list):
fields = getattr(obj, f"get_typographie_{field_name}_fields")()
setattr(
obj,
field_name,
[apply_typographie_to_dict(item, fields) for item in field],
)

# Is it a FK, a OneToOne or reversed OneToOne
elif issubclass(field.__class__, models.Model):
apply_typographie(field)

# Is it a M2M or a reversed M2M
elif issubclass(field.__class__, models.Manager):
for related in field.all():
apply_typographie(related)

obj.save()


class TypographieAdmin(admin.ModelAdmin):
def _info(self):
return {
"app_label": self.model._meta.app_label,
"model_name": self.model._meta.model_name,
}

def get_urls(self):
from django.urls import re_path

urlpatterns = super().get_urls()

def wrap(view):
def wrapper(*args, **kwargs):
return self.admin_site.admin_view(view)(*args, **kwargs)

return update_wrapper(wrapper, view)

typo_url = [
re_path(
r"^(.+)/typo/$",
wrap(self.typo_view),
name="{app_label}_{model_name}_typo".format(**self._info()),
)
]

return typo_url + urlpatterns

def typo_view(self, request, object_id, extra_contexte=None):
obj = get_object_or_404(self.get_queryset(request), pk=unquote(object_id))

if not self.has_change_permission(request, obj):
raise PermissionDenied

apply_typographie(obj)

return redirect(
reverse(
"admin:{app_label}_{model_name}_change".format(**self._info()),
args=(object_id,),
)
)

def save_related(self, request, form, formsets, change):
super().save_related(request, form, formsets, change)

if "_save_with_typo" in request.POST:
apply_typographie(form.instance)

def response_change(self, request, obj):
if "_save_with_typo" in request.POST:
msg_dict = {
"name": self.model._meta.verbose_name,
"obj": format_html('<a href="{}">{}</a>', urlquote(request.path), obj),
}
msg = format_html(
"L'objet {name} {obj} a été modifié avec succès. Le filtre typo a été passé. "
"Vous pouvez continuer l'édition ci-dessous.",
**msg_dict,
)
messages.add_message(request, messages.SUCCESS, msg)

return HttpResponseRedirect(
reverse(
"admin:{app_label}_{model_name}_change".format(**self._info()),
args=(str(obj.pk),),
)
)

return super().response_change(request, obj)
Loading