-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: Allow lazy wizard initialization (#8266) #8283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* fix: Allow lazy wizard initialization (#8265) * fix: Allow lazy wizard initialization * Update cms/cms_toolbars.py Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * Update cms/cms_config.py Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * feat: add "clear_wizard_cache" * fix: Wizard pool depr message * Update wizard_base.py * fix linting --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Reviewer's GuideThis backport extracts wizard utility functions into a new helpers module, updates the get_entries API to return Wizard objects, adds a cache-clearing function for lazy initialization, and adjusts imports accordingly. Class diagram for wizard utility refactorclassDiagram
class WizardBase
class Wizard
class CMSAppConfig {
+cms_extension
}
class CMSExtension {
+wizards: dict
}
class User
class Page
CMSAppConfig --> CMSExtension : cms_extension
CMSExtension --> Wizard : wizards
WizardBase <|-- Wizard
class helpers {
+get_entries()
+get_entry(entry_key)
+entry_choices(user, page)
+clear_wizard_cache()
}
helpers ..> Wizard : returns
helpers ..> User : uses
helpers ..> Page : uses
helpers ..> CMSExtension : accesses wizards
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
👋 Hi there! Please remember to MERGE COMMIT pull requests from Do not SQUASH commits to preserve history for the changelog. |
👋 Hi there! Please remember to MERGE COMMIT pull requests from Do not SQUASH commits to preserve history for the changelog. |
👋 Hi there! Please remember to MERGE COMMIT pull requests from Do not SQUASH commits to preserve history for the changelog. |
👋 Hi there! Please remember to MERGE COMMIT pull requests from Do not SQUASH commits to preserve history for the changelog. |
Description
Backport of #8266
Related resources
Checklist
main
Summary by Sourcery
Extract wizard utility functions into a dedicated helpers module, update get_entries and entry_choices to support lazy loading of Wizard objects, and add a clear_wizard_cache function to allow dynamic refreshing of the wizard registry.
Enhancements: