djblets.integrations.urls¶
URL helpers for integrations.
- build_integration_urlpatterns(*, list_view_cls: Type[BaseIntegrationListView], config_form_view_cls: Type[BaseIntegrationConfigFormView], namespace: Optional[str] = None, app_name: Optional[str] = None) List[_AnyURL][source]¶
Build URL patterns for integration pages.
This will produce a set of URL patterns for the integration administration pages that take advantage of the specialized views provided. These can be used in a
urls.py, either returned as aurlpatternsvariable or included usinginclude().Changed in version 3.2:
Added the optional
app_nameargument.Keyword arguments are now expected, and will be required in Djblets 4.
- Parameters:
list_view_cls (
type, optional) –The view responsible for listing available integrations. This should be a subclass of
BaseIntegrationListView.If
None, the integration list URL will not be provided in the URL patterns. Consumers should define their ownintegration-listURL with the appropriate namespace in order to handle any URL reversing that may occur.config_form_view_cls (
type) –The view responsible for configuring an integration. This should be a subclass of
BaseIntegrationConfigFormView.If
None, the integration configuration URLs will not be provided in the URL patterns. This will break the integrations list URL unless consumers provide their ownintegration-add-configandintegration-change-configURL registrations.namespace (
str, optional) –The namespace to use for all URL names.
For legacy reasons, this is an empty string. If embedding into other parts of the app, this should be changed. For instance, you may want the admin version to use
admin.app_name (
str, optional) –An optional app name to assign to the URLs.
This is required by Django when using
namespacestarting in Django 3.x.New in version 3.2.
- Returns:
The list of URL patterns.
- Return type: