Exemple #1
0
def activate():
    with current_app.app_context():
        rules = [
            rule for rule in current_app.url_map._rules
            if is_service_rule(rule, current_app)
        ]
        for rule in rules:
            current_app.url_map._rules.remove(rule)
            current_app.url_map._rules_by_endpoint.pop(rule.endpoint, None)
            current_app.view_functions.pop(rule.endpoint, None)
        sandman2.AutomapModel.classes.clear()
        sandman2.AutomapModel.metadata.clear()
        sandman2._reflect_all(Base=AutomapModel)
        current_app.__spec__ = swagger.make_spec(current_app)
Exemple #2
0
def activate():
    with current_app.app_context():
        rules = [
            rule for rule in current_app.url_map._rules
            if is_service_rule(rule, current_app)
        ]
        for rule in rules:
            current_app.url_map._rules.remove(rule)
            current_app.url_map._rules_by_endpoint.pop(rule.endpoint, None)
            current_app.view_functions.pop(rule.endpoint, None)
        sandman2.AutomapModel.classes.clear()
        sandman2.AutomapModel.metadata.clear()
        sandman2._reflect_all(Base=AutomapModel)
        current_app.__spec__ = swagger.make_spec(current_app)
Exemple #3
0
def activate():
    with current_app.app_context():
        rules = [
            rule for rule in current_app.url_map._rules
            if is_service_rule(rule, current_app)
        ]
        for rule in rules:
            current_app.url_map._rules.remove(rule)
            current_app.url_map._rules_by_endpoint.pop(rule.endpoint, None)
            current_app.view_functions.pop(rule.endpoint, None)
        sandman2.AutomapModel.classes.clear()
        sandman2.AutomapModel.metadata.clear()
        sandman2._reflect_all(Base=AutomapModel)
        tables = get_tables()
        sandman2.unregister_services(to_keep=tables)
        current_app.__spec__ = swagger.make_spec(current_app)
        current_app.config['SQLALCHEMY_TABLES'] = tables
Exemple #4
0
def activate():
    with current_app.app_context():
        rules = [
            rule
            for rule in current_app.url_map._rules
            if is_service_rule(rule, current_app)
        ]
        for rule in rules:
            current_app.url_map._rules.remove(rule)
            current_app.url_map._rules_by_endpoint.pop(rule.endpoint, None)
            current_app.view_functions.pop(rule.endpoint, None)
        sandman2.AutomapModel.classes.clear()
        sandman2.AutomapModel.metadata.clear()
        sandman2._reflect_all(Base=AutomapModel)
        tables = get_tables()
        sandman2.unregister_services(to_keep=tables)
        current_app.__spec__ = swagger.make_spec(current_app)
        current_app.config['SQLALCHEMY_TABLES'] = tables