diff --git a/django_quill/fields.py b/django_quill/fields.py index fd92982..8f987aa 100644 --- a/django_quill/fields.py +++ b/django_quill/fields.py @@ -14,7 +14,7 @@ class FieldQuill: def __init__(self, instance, field, json_string): self.instance = instance self.field = field - self.json_string = json_string + self.json_string = json_string or '{"delta":"","html":""}' self._committed = True def __eq__(self, other): @@ -142,3 +142,7 @@ def get_prep_value(self, value): if isinstance(value, Quill): return value.json_string return value + + def value_to_string(self, obj): + value = self.value_from_object(obj) + return self.get_prep_value(value) diff --git a/django_quill/templates/django_quill/widget.html b/django_quill/templates/django_quill/widget.html index a3f1cb6..90d1c85 100644 --- a/django_quill/templates/django_quill/widget.html +++ b/django_quill/templates/django_quill/widget.html @@ -3,14 +3,46 @@
\ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7f9ccf1..afed9a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,9 @@ name = "django-quill-editor" version = "0.1.0" description = "" authors = ["이한영 "] +packages = [ + { include = "django_quill" }, +] [tool.poetry.dependencies] python = "^3.7" diff --git a/setup.py b/setup.py index 452dcea..8fc23fb 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,9 @@ #!/usr/bin/env python import os + from setuptools import find_packages, setup -ROOT_DIR = os.path.dirname(os.path.dirname(__file__)) +ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) README = open(os.path.join(ROOT_DIR, 'README.md')).read() VERSION = open(os.path.join(ROOT_DIR, 'version.txt')).read()