-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Nested blueprints #3923
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
Nested blueprints #3923
Conversation
|
Building the Shopyo framework which makes use of this idea (not for nested but normal blueprints), i posed the question of infinity. It is better expressed in ThiefMaster's words: "Wouldn't a proper implementation of "sub-blueprints" pretty much automatically support infinite nesting of blueprints, too, anyway?" How does this PR address the issue? |
|
@Abdur-rahmaanJ This supports infinite nesting, subject to resource limitations, so I don't think there is an issue. |
2684eea to
7c60412
Compare
|
I'm not sure if any additional documentation is required, as the nesting should work as a user would expect - therefore I think it is best just to note that nesting is possible. |
68125b8 to
8e21346
Compare
This allows blueprints to be nested within blueprints via a new Blueprint.register_blueprint method. This should provide a use case that has been desired for the past ~10 years. This works by setting the endpoint name to be the blueprint names, from parent to child delimeted by "." and then iterating over the blueprint names in reverse order in the app (from most specific to most general). This means that the expectation of nesting a blueprint within a nested blueprint is met.
|
I added a few more lines of documentation mentioning that URL prefixes are applied like |
|
🎉 |
|
so exciting, great work 👏 |
|
This is the day I've been waiting for!🎉 |
This allows blueprints to be nested within blueprints via a new
Blueprint.register_blueprint method. This should provide a use case
that has been desired for the past ~10 years.
This works by setting the endpoint name to be the blueprint names,
from parent to child delimeted by "." and then iterating over the
blueprint names in reverse order in the app (from most specific to
most general). This means that the expectation of nesting a blueprint
within a nested blueprint is met.
Checklist:
CHANGES.rstsummarizing the change and linking to the issue... versionchanged::entries in any relevant code docs.pre-commithooks and fix any issues.pytestandtox, no tests failed.