mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-10-26 08:58:58 +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
|
"""Custom version of :see:BleachField that is actually a
|
||||||
:see:LocalizedField."""
|
:see:LocalizedField."""
|
||||||
|
|
||||||
|
DEFAULT_SHOULD_ESCAPE = True
|
||||||
|
|
||||||
def __init__(self, *args, escape=True, **kwargs):
|
def __init__(self, *args, escape=True, **kwargs):
|
||||||
"""Initializes a new instance of :see:LocalizedBleachField."""
|
"""Initializes a new instance of :see:LocalizedBleachField."""
|
||||||
|
|
||||||
@@ -16,6 +18,14 @@ class LocalizedBleachField(LocalizedField):
|
|||||||
|
|
||||||
super().__init__(*args, **kwargs)
|
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):
|
def pre_save(self, instance, add: bool):
|
||||||
"""Ran just before the model is saved, allows us to built the slug.
|
"""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(
|
setup(
|
||||||
name="django-localized-fields",
|
name="django-localized-fields",
|
||||||
version="6.8b1",
|
version="6.8b3",
|
||||||
packages=find_packages(exclude=["tests"]),
|
packages=find_packages(exclude=["tests"]),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
license="MIT License",
|
license="MIT License",
|
||||||
@@ -74,7 +74,7 @@ setup(
|
|||||||
install_requires=[
|
install_requires=[
|
||||||
"Django>=2.0",
|
"Django>=2.0",
|
||||||
"django-postgres-extra>=2.0,<3.0",
|
"django-postgres-extra>=2.0,<3.0",
|
||||||
"deprecation==2.0.7",
|
"deprecation>=2.0.7",
|
||||||
],
|
],
|
||||||
extras_require={
|
extras_require={
|
||||||
':python_version <= "3.6"': ["dataclasses"],
|
':python_version <= "3.6"': ["dataclasses"],
|
||||||
|
|||||||
Reference in New Issue
Block a user