Interfaces Reference¶
MedUX defines several GDAPS interfaces that plugins can implement to extend the system. This page documents all available extension points.
From medux.common.api.interfaces¶
MeduxPluginAppConfig¶
Base AppConfig for all MedUX plugins. Provides:
groups_permissions— dict mapping group names to permission lists. Groups and permissions are created automatically duringinitialize.initialize()— called by theinitializemanagement command. Override to set up plugin-specific data.compatibility_errors— cached property returning a list of blocking compatibility issues.compatibility_warnings— cached property returning a list of non-blocking warnings.
IAdministrationURL¶
The minimal hook for adding URL patterns under /administration/:
class MyAdminURL(IAdministrationURL):
namespace = "myplugin"
urlpatterns = [path("...", view, name="...")]
URL patterns are mounted at /administration/<namespace>/.
IAdministrationSection¶
A superset of IAdministrationURL that additionally carries menu
metadata and a permission-gating helper. Preferred over
IAdministrationURL for new plugins.
Key attributes:
namespace— URL namespace (mounted at/administration/<namespace>/)name— unique slugtitle— display nameicon— Tabler icon nameweight— ordering (lower = higher)parent_slug— parent rail group (e.g.,"tenant")url_name— entry point URL nametenant_admin_required— bool, gates on tenant admin statusurlpatterns— list of URL patternshas_permission(request)— classmethod for permission checking
See Administration Sections for full usage guide.
ITenantSection / ITenantSubSection¶
Add sections to the tenant administration settings.
ILoginFormExtension¶
Extend the login form with additional fields:
class MyLoginExtension(ILoginFormExtension):
def get_form_fields(self):
return {"my_field": forms.CharField()}
ILoginViewExtension¶
Extend the login view with additional logic.
IWebsocketURL¶
Add WebSocket URL patterns:
class MyWebsocketURL(IWebsocketURL):
urlpatterns = [path("ws/myfeature/", MyConsumer.as_asgi())]
TenantAdminRequiredMixin¶
View mixin that restricts access to tenant administrators.
user_is_tenant_admin(request)¶
Helper function that checks if the current user is a tenant admin
(superuser, has common.change_tenant permission, or has admin
TenantMembership).
TENANT_ADMIN_PERMISSION¶
The permission string used for tenant admin checks
("common.change_tenant").
From medux.core.api.interfaces¶
IGlobalJavascript¶
Inject a JavaScript file that is loaded on every page:
class MyGlobalJS(IGlobalJavascript):
src = "myplugin/js/global.js"
ICommand¶
Register a command for the command palette:
class MyCommand(ICommand):
title = _("Do something")
icon = "wand"
url = reverse_lazy("myplugin:do-something")
IDashboardSection¶
Add a widget to the dashboard:
class MyDashboardWidget(IDashboardSection):
title = _("My Widget")
template_name = "myplugin/dashboard_widget.html"
weight = 20
From Conjunto¶
IMenuItem¶
Add a menu entry. See Menu System for details.
ISettingsSection¶
Add a settings form section to the /settings/ page. See
Scoped Settings for details.