-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Closed
Labels
Milestone
Description
I'd like to be able to register "sub-blueprints" using Blueprint.register_blueprint(*args, **kwargs). This would register the nested blueprints with an app when the "parent" is registered with it. All parameters are preserved, other than url_prefix, which is handled similarly to in add_url_rule. A naíve implementation could look like this:
class Blueprint(object):
...
def register_blueprint(self, blueprint, **options):
def deferred(state):
url_prefix = options.get('url_prefix')
if url_prefix is None:
url_prefix = blueprint.url_prefix
if 'url_prefix' in options:
del options['url_prefix']
state.app.register_blueprint(blueprint, url_prefix, **options)
self.record(deferred)thanhson1085, CatarinaPBressan, IAPark, lukeyeager, gneub and 49 more