Skip to content

Commit 63b3067

Browse files
davidismpgjones
authored andcommitted
changelog for blueprint registered name
1 parent 67b0b7e commit 63b3067

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

CHANGES.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ Unreleased
2727
removed early. :issue:`4078`
2828
- Improve typing for some functions using ``Callable`` in their type
2929
signatures, focusing on decorator factories. :issue:`4060`
30+
- Nested blueprints are registered with their dotted name. This allows
31+
different blueprints with the same name to be nested at different
32+
locations. :issue:`4069`
33+
- ``register_blueprint`` takes a ``name`` option to change the
34+
(pre-dotted) name the blueprint is registered with. This allows the
35+
same blueprint to be registered multiple times with unique names for
36+
``url_for``. :issue:`1091`
3037

3138

3239
Version 2.0.0

src/flask/app.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,12 @@ def register_blueprint(self, blueprint: "Blueprint", **options: t.Any) -> None:
10191019
:class:`~flask.blueprints.BlueprintSetupState`. They can be
10201020
accessed in :meth:`~flask.Blueprint.record` callbacks.
10211021
1022+
.. versionchanged:: 2.0.1
1023+
The ``name`` option can be used to change the (pre-dotted)
1024+
name the blueprint is registered with. This allows the same
1025+
blueprint to be registered multiple times with unique names
1026+
for ``url_for``.
1027+
10221028
.. versionadded:: 0.7
10231029
"""
10241030
blueprint.register(self, options)

src/flask/blueprints.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ def register_blueprint(self, blueprint: "Blueprint", **options: t.Any) -> None:
252252
arguments passed to this method will override the defaults set
253253
on the blueprint.
254254
255+
.. versionchanged:: 2.0.1
256+
The ``name`` option can be used to change the (pre-dotted)
257+
name the blueprint is registered with. This allows the same
258+
blueprint to be registered multiple times with unique names
259+
for ``url_for``.
260+
255261
.. versionadded:: 2.0
256262
"""
257263
self._blueprints.append((blueprint, options))
@@ -266,6 +272,17 @@ def register(self, app: "Flask", options: dict) -> None:
266272
with.
267273
:param options: Keyword arguments forwarded from
268274
:meth:`~Flask.register_blueprint`.
275+
276+
.. versionchanged:: 2.0.1
277+
Nested blueprints are registered with their dotted name.
278+
This allows different blueprints with the same name to be
279+
nested at different locations.
280+
281+
.. versionchanged:: 2.0.1
282+
The ``name`` option can be used to change the (pre-dotted)
283+
name the blueprint is registered with. This allows the same
284+
blueprint to be registered multiple times with unique names
285+
for ``url_for``.
269286
"""
270287
first_registration = True
271288

0 commit comments

Comments
 (0)