override_script_prefix
Decorator or context manager to temporary override the script prefix.
Attributes
| Attribute | Type | Description |
|---|---|---|
| prefix | string | The temporary URL path prefix to be applied during the execution of the decorated function or context block. |
| old_prefix | string | Stores the original script prefix retrieved at activation to ensure it can be restored when the context is disabled. |
Constructor
Signature
def override_script_prefix(
prefix: string
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| prefix | string | The temporary script prefix to be applied. |
Signature
def override_script_prefix(
prefix: string
)
Parameters
| Name | Type | Description |
|---|---|---|
| prefix | string | The temporary script prefix to be set during the execution of the decorated function or context block. |
Methods
enable()
@classmethod
def enable() - > null
Activates the override by storing the current script prefix and setting the new prefix globally.
Returns
| Type | Description |
|---|---|
null | Nothing is returned; the global script prefix state is modified. |
disable()
@classmethod
def disable() - > null
Deactivates the override by restoring the script prefix to the original value captured during the enable call.
Returns
| Type | Description |
|---|---|
null | Nothing is returned; the global script prefix state is restored. |