3 Commits

Author SHA1 Message Date
Bogdan Hopulele
a55986d28c Bump version number to 6.8b3 2024-03-01 19:53:18 +02:00
Bogdan Hopulele
bcd1f1cc1a Relax "deprecation" dependency 2024-03-01 19:46:45 +02:00
GRazvan12
463c415be2 Add deconstruct method for LocalizedBleachField for it to be recognized in django migrations 2024-01-23 16:45:57 +01:00
2 changed files with 12 additions and 2 deletions

View File

@@ -9,6 +9,8 @@ class LocalizedBleachField(LocalizedField):
"""Custom version of :see:BleachField that is actually a
:see:LocalizedField."""
DEFAULT_SHOULD_ESCAPE = True
def __init__(self, *args, escape=True, **kwargs):
"""Initializes a new instance of :see:LocalizedBleachField."""
@@ -16,6 +18,14 @@ class LocalizedBleachField(LocalizedField):
super().__init__(*args, **kwargs)
def deconstruct(self):
name, path, args, kwargs = super().deconstruct()
if self.escape != self.DEFAULT_SHOULD_ESCAPE:
kwargs["escape"] = self.escape
return name, path, args, kwargs
def pre_save(self, instance, add: bool):
"""Ran just before the model is saved, allows us to built the slug.

View File

@@ -36,7 +36,7 @@ with open(
setup(
name="django-localized-fields",
version="6.8b1",
version="6.8b3",
packages=find_packages(exclude=["tests"]),
include_package_data=True,
license="MIT License",
@@ -74,7 +74,7 @@ setup(
install_requires=[
"Django>=2.0",
"django-postgres-extra>=2.0,<3.0",
"deprecation==2.0.7",
"deprecation>=2.0.7",
],
extras_require={
':python_version <= "3.6"': ["dataclasses"],