Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for general FieldPanel with Wagtail 3.0+ #155

Open
zerolab opened this issue Apr 10, 2022 · 2 comments
Open

Add support for general FieldPanel with Wagtail 3.0+ #155

zerolab opened this issue Apr 10, 2022 · 2 comments
Milestone

Comments

@zerolab
Copy link
Member

zerolab commented Apr 10, 2022

References:

Where possible, third-party packages that implement their own field panel types should be updated to allow using a plain FieldPanel instead, in line with Wagtail dropping its own special-purpose field panel types such as StreamFieldPanel and ImageChooserPanel. The steps for doing this will depend on the package’s functionality, but in general:

  • If the panel sets a custom template, your code should instead define a Widget class that produces your desired HTML rendering.
  • If the panel provides a widget_overrides method, your code should instead call register_form_field_override so that the desired widget is always selected for the relevant model field type.
  • If the panel provides a get_comparison_class method, your code should instead call wagtail.admin.compare.register_comparison_class to register the comparison class against the relevant model field type.

Fix deprecations too:

deprecations
tests/test_edit_handlers.py:202: RemovedInWagtail50Warning: The MediaChooserPanel.bind_to() method has been replaced by bind_to_model(model) and get_bound_panel(instance=instance, request=request, form=form)
  media_chooser_panel = self.my_media_chooser_panel.bind_to(
/home/runner/work/wagtailmedia/wagtailmedia/tests/test_edit_handlers.py:205: RemovedInWagtail50Warning: Panel.render_as_field is deprecated. Use render_html instead
  result = media_chooser_panel.render_as_field()
tests/test_edit_handlers.py:143: RemovedInWagtail50Warning: Panel.render_as_field is deprecated. Use render_html instead
  result = self.media_chooser_panel.render_as_field()
tests/test_edit_handlers.py:172: RemovedInWagtail50Warning: Panel.render_as_field is deprecated. Use render_html instead
  result = media_chooser_panel.render_as_field()
tests/test_edit_handlers.py:248: RemovedInWagtail50Warning: Panel.render_as_field is deprecated. Use render_html instead
  media_chooser_panel.render_as_field(),
tests/test_edit_handlers.py:121: RemovedInWagtail50Warning: Panel.render_as_field is deprecated. Use render_html instead
  self.media_chooser_panel.render_as_field(),
tests/test_edit_handlers.py:130: RemovedInWagtail50Warning: Panel.render_as_field is deprecated. Use render_html instead
  media_chooser_panel.render_as_field(),
@zerolab zerolab added this to the 0.12 milestone Oct 15, 2022
@zerolab zerolab modified the milestones: 0.12, The big tidy up Nov 4, 2022
@Scotchester
Copy link
Collaborator

This got done, right?

@zerolab
Copy link
Member Author

zerolab commented Nov 22, 2022

Not to my knowledge.
Chances are things just work for MediaChooserPanel.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants