Skip to content

Commit

Permalink
changelog for blueprint registered name
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism authored and pgjones committed May 21, 2021
1 parent 67b0b7e commit 63b3067
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ Unreleased
removed early. :issue:`4078`
- Improve typing for some functions using ``Callable`` in their type
signatures, focusing on decorator factories. :issue:`4060`
- Nested blueprints are registered with their dotted name. This allows
different blueprints with the same name to be nested at different
locations. :issue:`4069`
- ``register_blueprint`` takes a ``name`` option to change the
(pre-dotted) name the blueprint is registered with. This allows the
same blueprint to be registered multiple times with unique names for
``url_for``. :issue:`1091`


Version 2.0.0
Expand Down
6 changes: 6 additions & 0 deletions src/flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,12 @@ def register_blueprint(self, blueprint: "Blueprint", **options: t.Any) -> None:
:class:`~flask.blueprints.BlueprintSetupState`. They can be
accessed in :meth:`~flask.Blueprint.record` callbacks.
.. versionchanged:: 2.0.1
The ``name`` option can be used to change the (pre-dotted)
name the blueprint is registered with. This allows the same
blueprint to be registered multiple times with unique names
for ``url_for``.
.. versionadded:: 0.7
"""
blueprint.register(self, options)
Expand Down
17 changes: 17 additions & 0 deletions src/flask/blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ def register_blueprint(self, blueprint: "Blueprint", **options: t.Any) -> None:
arguments passed to this method will override the defaults set
on the blueprint.
.. versionchanged:: 2.0.1
The ``name`` option can be used to change the (pre-dotted)
name the blueprint is registered with. This allows the same
blueprint to be registered multiple times with unique names
for ``url_for``.
.. versionadded:: 2.0
"""
self._blueprints.append((blueprint, options))
Expand All @@ -266,6 +272,17 @@ def register(self, app: "Flask", options: dict) -> None:
with.
:param options: Keyword arguments forwarded from
:meth:`~Flask.register_blueprint`.
.. versionchanged:: 2.0.1
Nested blueprints are registered with their dotted name.
This allows different blueprints with the same name to be
nested at different locations.
.. versionchanged:: 2.0.1
The ``name`` option can be used to change the (pre-dotted)
name the blueprint is registered with. This allows the same
blueprint to be registered multiple times with unique names
for ``url_for``.
"""
first_registration = True

Expand Down

0 comments on commit 63b3067

Please sign in to comment.