mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-10-23 08:08:56 +03:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a55986d28c | ||
|
bcd1f1cc1a | ||
|
463c415be2 |
@@ -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.
|
||||
|
||||
|
4
setup.py
4
setup.py
@@ -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"],
|
||||
|
Reference in New Issue
Block a user