Skip to content

Commit

Permalink
Merge pull request #9 from wagtail-packages/8-modeladmin-discovery-go…
Browse files Browse the repository at this point in the history
…t-removed

Add hooks page back to sandbox
  • Loading branch information
nickmoreton authored Feb 16, 2024
2 parents 89e8698 + 0172b19 commit b07a597
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ EXPOSAPI_CONFIG = {

## Tested With

- Python 3.8, 3.9, 3.10, 3,11
- Django 3.2, 4.0, 4.1, 4.2
- Wagtail 4.2, 5.0, 5.1, 5.2
- Python 3.8, 3.9, 3.10, 3,11, 3.12
- Django 3.2, 4.0, 4.1, 4.2, 5.0
- Wagtail 4.1, 4.2, 5.0, 5.1, 5.2, 6.0

Wagtail 5.1 can be used with wagtail-modeladmin 1.0.0 and wagtail 5.2 can be used with wagtail-modeladmin 2.0.0
Wagtail 5.1 can be used with wagtail-modeladmin 1.0.0 and wagtail 5.2+ can be used with wagtail-modeladmin 2.0.0

Model admin is only required if you still use it in your site.
50 changes: 50 additions & 0 deletions sandbox/home/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from wagtail import VERSION as WAGTAIL_VERSION

if WAGTAIL_VERSION >= (5, 1):
from wagtail_modeladmin.options import ModelAdmin, modeladmin_register
else:
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register

from .models import TestModelAdminOne, TestModelAdminThree, TestModelAdminTwo


class TestModelAdminOneAdmin(ModelAdmin):
model = TestModelAdminOne
menu_label = "Model Admin One"
menu_icon = "pilcrow"
menu_order = 200
add_to_settings_menu = False
exclude_from_explorer = False
list_display = ("title",)
search_fields = ("title",)


modeladmin_register(TestModelAdminOneAdmin)


class TestModelAdminTwoAdmin(ModelAdmin):
model = TestModelAdminTwo
menu_label = "Model Admin Two"
menu_icon = "pilcrow"
menu_order = 200
add_to_settings_menu = False
exclude_from_explorer = False
list_display = ("title",)
search_fields = ("title",)


modeladmin_register(TestModelAdminTwoAdmin)


class TestModelAdminThreeAdmin(ModelAdmin):
model = TestModelAdminThree
menu_label = "Model Admin Three"
menu_icon = "pilcrow"
menu_order = 200
add_to_settings_menu = False
exclude_from_explorer = False
list_display = ("title",)
search_fields = ("title",)


modeladmin_register(TestModelAdminThreeAdmin)

0 comments on commit b07a597

Please sign in to comment.