Utilities

Settings to control the behavior of this library.

exception notifications_api_common.utils.NotAViewSet
notifications_api_common.utils.get_domain() str

Derive the domain where the application is hosted.

notifications_api_common.utils.get_resource_for_path(path: str) Model

Retrieve the API instance belonging to a (detail) path.

notifications_api_common.utils.get_site_domain() str

Derive the domain where the application is hosted.

You can provide an alternative implementation via the NOTIFICATIONS_API_GET_DOMAIN setting, which takes a dotted path to a callable taking no arguments.

notifications_api_common.utils.get_viewset_for_path(path: str, method='GET') GenericViewSet

Look up which viewset matches a path.

notifications_api_common.utils.notification_documentation(kanaal: Kanaal)

Generate notification documentation for an OpenAPI specification containing the relevant resources and actions for a given KANAAL