Skip to content
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

Allow imports from wagtail_modeladmin #33

Closed
wants to merge 1 commit into from
Closed

Conversation

soh55
Copy link

@soh55 soh55 commented Feb 7, 2024

When using this library with wagtail_modeladmin == 2.0.0 we face an ImportError from wagtail_hooks.py. This is caused by the following imports:

from wagtail.contrib.modeladmin.helpers import ButtonHelper, PermissionHelper
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtail.contrib.modeladmin.views import DeleteView, IndexView

I've added a try-except to import first from wagtail_modeladmin, then fall back to the original namespace.

@marteinn
Copy link
Member

Hi @soh55 and thanks for the PR! I have reviewed it and since modeladmin is deprecated in Wagtail 5 we can just bundle wagtail-modeladmin. So I went with this approach. You can see my approach here ae51631

I'm closing this PR as we now have Wagtail 6 in wagtail-trash 3.0.0, but many thanks for letting us know that the plugin did not support Wagtail 6! 🙏

@marteinn marteinn closed this Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants