-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from wagtail-packages/8-modeladmin-discovery-go…
…t-removed Add hooks page back to sandbox
- Loading branch information
Showing
2 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |