Nested blueprints

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.
This commit is contained in:
pgjones 2021-02-24 21:18:12 +00:00 committed by David Lord
parent 85dce2c836
commit f92e820b4b
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
5 changed files with 154 additions and 56 deletions

View file

@ -69,6 +69,7 @@ Unreleased
``@app.route("/login", methods=["POST"])``. :pr:`3907`
- Support async views, error handlers, before and after request, and
teardown functions. :pr:`3412`
- Support nesting blueprints. :issue:`593, 1548`, :pr:`3923`
Version 1.1.2