Skip to content

Commit

Permalink
Update admin module paths to menuadmin
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kirkham authored and MrCordeiro committed Feb 26, 2024
1 parent 56f98d2 commit 077528f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions docs/source/settings_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ By default, 'Flat menus' are editable in the Wagtail CMS. Setting this to ``Fals

.. _FLAT_MENUS_MODELADMIN_CLASS:

``WAGTAILMENUS_FLAT_MENUS_MODELADMIN_CLASS``
``WAGTAILMENUS_FLAT_MENUS_ADMIN_CLASS``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Default value: ``'wagtailmenus.modeladmin.FlatMenuAdmin'``
Default value: ``'wagtailmenus.menuadmin.FlatMenuAdmin'``

If you wish to override the ``ModelAdmin`` class used to represent **'Flat menus'** in the Wagtail admin area for your project (e.g. to display additional custom fields in the listing view, or change/add new views), you can do so by using this setting to swap out the default class for a custom one. e.g.
If you wish to override the admin class used to represent **'Flat menus'** in the Wagtail admin area for your project (e.g. to display additional custom fields in the listing view, or change/add new views), you can do so by using this setting to swap out the default class for a custom one. e.g.

.. code-block:: python
# e.g. settings/base.py
WAGTAILMENUS_FLAT_MENUS_MODELADMIN_CLASS = "projectname.appname.modulename.ClassName"
WAGTAILMENUS_FLAT_MENUS_ADMIN_CLASS = "projectname.appname.modulename.ClassName"
The value should be an import path string, rather than a direct pointer to the class itself. wagtailmenus will lazily import the class from this path when it is required. If the path is invalid, an ``ImproperlyConfigured`` exception will be raised.
Expand Down Expand Up @@ -110,12 +110,12 @@ By default, 'Main menus' are editable in the Wagtail CMS. Setting this to ``Fals

.. _MAIN_MENUS_MODELADMIN_CLASS:

``WAGTAILMENUS_MAIN_MENUS_MODELADMIN_CLASS``
``WAGTAILMENUS_MAIN_MENUS_ADMIN_CLASS``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Default value: ``'wagtailmenus.modeladmin.MainMenuAdmin'``
Default value: ``'wagtailmenus.menuadmin.MainMenuAdmin'``

If you wish to override the ``ModelAdmin`` class used to represent **'Main menus'** in the Wagtail admin area for your project (e.g. to display additional custom fields in the listing view, or change/add new views), you can do so by using this setting to swap out the default class for a custom one. e.g.
If you wish to override the admin class used to represent **'Main menus'** in the Wagtail admin area for your project (e.g. to display additional custom fields in the listing view, or change/add new views), you can do so by using this setting to swap out the default class for a custom one. e.g.

.. code-block:: python
Expand Down
4 changes: 2 additions & 2 deletions wagtailmenus/conf/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

FLAT_MENUS_EDITABLE_IN_WAGTAILADMIN = True

FLAT_MENUS_ADMIN_CLASS = 'wagtailmenus.modeladmin.FlatMenuAdmin'
FLAT_MENUS_ADMIN_CLASS = 'wagtailmenus.menuadmin.FlatMenuAdmin'

FLAT_MENUS_HANDLE_CHOICES = None

MAINMENU_MENU_ICON = 'list-ol'

MAIN_MENUS_EDITABLE_IN_WAGTAILADMIN = True

MAIN_MENUS_ADMIN_CLASS = 'wagtailmenus.modeladmin.MainMenuAdmin'
MAIN_MENUS_ADMIN_CLASS = 'wagtailmenus.menuadmin.MainMenuAdmin'

USE_CONDENSEDINLINEPANEL = True

Expand Down
2 changes: 1 addition & 1 deletion wagtailmenus/conf/tests/test_menuadmin_disable_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.test import TestCase, override_settings

from wagtailmenus import wagtail_hooks
from wagtailmenus.modeladmin import FlatMenuAdmin, MainMenuAdmin
from wagtailmenus.menuadmin import FlatMenuAdmin, MainMenuAdmin

modeladmin_register_str = 'wagtail.snippets.models.register_snippet'

Expand Down
6 changes: 3 additions & 3 deletions wagtailmenus/tests/menuadmin.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from wagtailmenus.modeladmin import FlatMenuAdmin, MainMenuAdmin
from wagtailmenus.menuadmin import FlatMenuAdmin, MainMenuAdmin


class CustomFlatMenuModelAdmin(FlatMenuAdmin):
class CustomFlatMenuAdmin(FlatMenuAdmin):
pass


class CustomMainMenuModelAdmin(MainMenuAdmin):
class CustomMainMenuAdmin(MainMenuAdmin):
pass

0 comments on commit 077528f

Please sign in to comment.