wagtail / wagtail-generic-chooser

A toolkit for custom chooser popups in Wagtail
BSD 3-Clause "New" or "Revised" License
116 stars 25 forks source link

Model Chooser Panel #16

Closed Redhaus closed 4 years ago

Redhaus commented 4 years ago

I am trying to create a Model Chooser panel much like a snippet chooser panel but I do not understand the implementations of how to do this with wagtail-generic-chooser.

typically I import snippetChooserPanel the use it to display a FK reference in another model.

panels = [ SnippetChooserPanel('MODELFIELD') ]

I want to do the same exact thing with all of the features and functionality of snippetChooserPanel but for ModelAdmin Models like

https://github.com/ixc/wagtail-instance-selector Is close but it does not work in Django 3

The other modelAdmin solutions you reference have similar issues.

Accordingly, assuming you can create a modelChooserPanel like the one for snippets or pages, How would I utilize the subclass I create so that it works in the panels list?

Please advise.

Thank you

gasman commented 4 years ago

Hi @Redhaus - there's an example of using this in a panel-based form in the documentation, at https://github.com/wagtail/wagtail-generic-chooser#chooser-widgets-model-based .

Please use the Wagtail tag on Stack Overflow for support queries, or see the Support page in the documentation for other options.