-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Move SnippetViewSet.get_edit_handler()
to ModelViewSet
#10830
Merged
Merged
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
Manage this branch in SquashTest this branch here: https://laymonagemodelviewset-edit-han-je9ic.squash.io |
laymonage
force-pushed
the
modelviewset-edit-handler
branch
from
August 29, 2023 14:31
2d59caa
to
dd92250
Compare
laymonage
force-pushed
the
modelviewset-edit-handler
branch
from
August 31, 2023 08:24
dd92250
to
d061116
Compare
laymonage
force-pushed
the
modelviewset-edit-handler
branch
from
October 5, 2023 15:19
d061116
to
20ee4e6
Compare
4 tasks
laymonage
force-pushed
the
modelviewset-edit-handler
branch
2 times, most recently
from
November 7, 2023 16:40
2159bfc
to
be8f10a
Compare
laymonage
force-pushed
the
modelviewset-edit-handler
branch
2 times, most recently
from
November 13, 2023 09:11
14611ea
to
d897573
Compare
gasman
approved these changes
Nov 27, 2023
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.
LGTM!
…edit views' templates
However, keep the logic for falling back to extracting panel definitions from the model class as snippets-specific. ModelViewSets are likely used with models that are more low-level and thus we want developers to explicitly define the fields that are editable in the admin, just like how Django's ModelForm works.
…EditView templates
laymonage
force-pushed
the
modelviewset-edit-handler
branch
from
November 28, 2023 09:33
d897573
to
3891677
Compare
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.
Part of #10740. This allows using the Panels mechanism to render the form for
ModelViewSet
by definingpanels
oredit_handler
on theModelViewSet
or model class.One difference from
SnippetViewSet
is thatModelViewSet
does not fall back to extracting the panel definitions from the model class if neitherpanels
noredit_handler
is defined, and instead will fall back to the original behaviour of requiring eitherform_fields
,exclude_form_fields
, or overridingget_form_class
.To test, you can use my bakerydemo branch where the
Country
model has been configured to use aModelViewSet
withpanels
.When reviewing, hide whitespace to get better diffs.
Please check the following:
make lint
from the Wagtail root.Footnotes
Development Testing ↩