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

Add support to wagtail6.0 using wagtail_modeladmin #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ Install with pip :

``pip install wagtailsvg``

Add these to django apps installed :
Add these to django apps installed. Only add the modeladmin line
corresponding the the wagtail version you are using.

.. code-block:: python

INSTALLED_APPS = [
'wagtailsvg',
'wagtail.contrib.modeladmin',
'wagtail.contrib.modeladmin', # only for wagtail <5.2
'wagtail_modeladmin', # only for wagtail >=5.2
'generic_chooser',
...
]
Expand Down
2 changes: 1 addition & 1 deletion conf/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
'wagtail',
'wagtail.contrib.settings',
'wagtail.contrib.frontend_cache',
'wagtail.contrib.modeladmin',
'wagtail_modeladmin',
'taggit',
'generic_chooser',

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Django>=4.1.7
wagtail>=4.1
flake8>=3.8.4
wagtail-generic-chooser==0.5.1
wagtail-modeladmin==2.0.0
14 changes: 10 additions & 4 deletions wagtailsvg/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
from wagtail.contrib.modeladmin.options import (
ModelAdmin,
modeladmin_register
)
try:
from wagtail.contrib.modeladmin.options import (
ModelAdmin,
modeladmin_register
)
except ImportError:
from wagtail_modeladmin.options import (
ModelAdmin,
modeladmin_register
)

try:
from wagtail import hooks
Expand Down