-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add QuillJSONField #36
Open
gokselcoban
wants to merge
27
commits into
LeeHanYeong:master
Choose a base branch
from
gokselcoban:json-field
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
9962c1b
Update README.md
LeeHanYeong be1352a
Bug fixes (#20)
michaldyczko 4d85604
Deletion of dynamically generated form processing logic, bug fix
LeeHanYeong e1288e2
Docs update
LeeHanYeong b6f26c1
Update widgets.py
Pierox57 d602b0d
Merge pull request #23 from Pierox57/patch-1
LeeHanYeong 2c6fe47
bump to 0.1.15
LeeHanYeong 76e6e72
Update setup.py classifiers
LeeHanYeong fe8ef8a
fix admin form style issues
gokselcoban 3533ed9
add image uploader
gokselcoban a362dca
rewrite QuillField to inherit JSONField (#27)
1ee92ab
Bump to Quill Version 1.3.7 (#34)
cdesch b7092cb
bump to 0.1.18
LeeHanYeong 3e838d3
add QuillJSONField
gokselcoban 4e11071
remove print
gokselcoban e4d1746
fix inconsistent quill versions (#37)
gokselcoban f867a96
bump to 0.1.19
LeeHanYeong dd66ea7
improve image uploader config
gokselcoban 25df5c2
add image uploads docs
gokselcoban fabe28f
minor documentation fix
gokselcoban 5452487
Merge branch 'master' of github.com:LeeHanYeong/django-quill-editor i…
gokselcoban 4cbf08c
Merge branch 'image-uploader' of github.com:cobang/django-quill-edito…
gokselcoban b7ae2ea
remove save methods
gokselcoban d0fef9d
add deprecation warnings
gokselcoban 0541e4e
update documentations
gokselcoban e7db4b8
Return value itself that holds the data on post requests
KaratasFurkan 84a9f95
Merge pull request #2 from KaratasFurkan/fix-empty-value-on-form-error
gokselcoban File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
import warnings | ||
|
||
from django import forms | ||
from .widgets import QuillWidget | ||
|
||
__all__ = ( | ||
'QuillFormField', | ||
'QuillFormJSONField' | ||
) | ||
|
||
|
||
class QuillFormField(forms.fields.CharField): | ||
class QuillFormJSONField(forms.JSONField): | ||
def __init__(self, *args, **kwargs): | ||
kwargs.update({ | ||
'widget': QuillWidget(), | ||
}) | ||
super().__init__(*args, **kwargs) | ||
|
||
def prepare_value(self, value): | ||
if hasattr(value, "data"): | ||
return value.data | ||
|
||
def has_changed(self, initial, data): | ||
if hasattr(initial, 'data'): | ||
initial = initial.data | ||
return super(QuillFormJSONField, self).has_changed(initial, data) | ||
|
||
|
||
def QuillFormField(*args, **kwargs): | ||
warnings.warn('QuillFormField is deprecated in favor of QuillFormJSONField', stacklevel=2) | ||
return QuillFormJSONField(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason this returns a text field instead of a json field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current users of the package, imports and uses
QuillField
which is based on text field. They may don't want to change the existing approach. It returns the text field for backward capability.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair point. i would just add a bit to the readme explaining the different fields so new users know what to use