|
|
@ -472,6 +472,7 @@ class Flask(_PackageBoundObject): |
|
|
|
#: |
|
|
|
#: |
|
|
|
#: .. versionadded:: 0.7 |
|
|
|
#: .. versionadded:: 0.7 |
|
|
|
self.blueprints = {} |
|
|
|
self.blueprints = {} |
|
|
|
|
|
|
|
self._blueprint_order = [] |
|
|
|
|
|
|
|
|
|
|
|
#: a place where extensions can store application specific state. For |
|
|
|
#: a place where extensions can store application specific state. For |
|
|
|
#: example this is where an extension could store database engines and |
|
|
|
#: example this is where an extension could store database engines and |
|
|
@ -903,9 +904,17 @@ class Flask(_PackageBoundObject): |
|
|
|
(blueprint, self.blueprints[blueprint.name], blueprint.name) |
|
|
|
(blueprint, self.blueprints[blueprint.name], blueprint.name) |
|
|
|
else: |
|
|
|
else: |
|
|
|
self.blueprints[blueprint.name] = blueprint |
|
|
|
self.blueprints[blueprint.name] = blueprint |
|
|
|
|
|
|
|
self._blueprint_order.append(blueprint) |
|
|
|
first_registration = True |
|
|
|
first_registration = True |
|
|
|
blueprint.register(self, options, first_registration) |
|
|
|
blueprint.register(self, options, first_registration) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def iter_blueprints(self): |
|
|
|
|
|
|
|
"""Iterates over all blueprints by the order they were registered. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.0 |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
return iter(self._blueprint_order) |
|
|
|
|
|
|
|
|
|
|
|
@setupmethod |
|
|
|
@setupmethod |
|
|
|
def add_url_rule(self, rule, endpoint=None, view_func=None, **options): |
|
|
|
def add_url_rule(self, rule, endpoint=None, view_func=None, **options): |
|
|
|
"""Connects a URL rule. Works exactly like the :meth:`route` |
|
|
|
"""Connects a URL rule. Works exactly like the :meth:`route` |
|
|
|