-
Notifications
You must be signed in to change notification settings - Fork 7
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
V0.1.5 #31
Open
aaronhaslett
wants to merge
72
commits into
master
Choose a base branch
from
v0.1.5
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
V0.1.5 #31
Conversation
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 hack was introduced to allow wagtailfontawesome icons to render with <span> tags, but it's kind of horrible so I'm pulling it out in favour of just using upstream wagtail icons for now.
DB conversion rules to support new wagtail's markup DB format
I don't know why this is necessary but 2.0.2 wagtail seems to want it
You need a strong background in draftail customization to understand this We're stuck with the following bad things: * We gotta save to the DB in the HTML format we're going to render. This means draftail is sharing that format so we have to save everything draftail needs. * There needs to be a system-unique DOM selector rule to find tags in the HTML to convert to contentstate for the draftail editor. To solve both at the same time we add an attr called modelchooser_choice_{} which holds the choice id, and the name of the attr resolves the unique DOM selector thing, because we can use span[modelchooser_choice_{}]. That's fine, frontend can just ignore it, but the big drawback is that draftail needs the DOM element's children so it can display the block, but then the frontend gets it too. Frontend does the correct thing and replaces the text with live data, but you see a flicker of the alt text. Really annoying, but will resolve soon with some kind of rewriter solution.
Upgrade/iconfix
…ser_validation fix remotemodelchooser validation
dases
reviewed
Jun 27, 2023
wagtailmodelchoosers/widgets.py
Outdated
if isinstance(value.pk, uuid.UUID): | ||
return str(value.pk) | ||
else: | ||
return value.pk | ||
return '' | ||
return value |
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.
When value
is None here we end up with stringified "None" as the value in form field.
Suggested change
return value | |
return value or "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.