Exemplo n.º 1
0
from flask_boilerplate_utils.overrides import NestableBlueprint

examples = NestableBlueprint('frontend.examples',
                             __name__,
                             template_folder="templates",
                             static_folder="static")

from .controllers.MainController import MainController
from .controllers.UploadsController import UploadsController
from .controllers.SecurityController import SecurityController
from .controllers.WTFormsController import WTFormsController
from .controllers.DocsController import DocsController
from .controllers.Features import Features
Features.register(examples)
MainController.register(examples)
UploadsController.register(examples)
SecurityController.register(examples)
WTFormsController.register(examples)
DocsController.register(examples)

from flask_menu.classy import register_flaskview
register_flaskview(examples, MainController)
register_flaskview(examples, UploadsController)
register_flaskview(examples, SecurityController)
register_flaskview(examples, WTFormsController)
register_flaskview(examples, Features)
register_flaskview(examples, DocsController)

from .modules.submodule import submodule
examples.register_blueprint(submodule, url_prefix='/submodule/<int:id>')
Exemplo n.º 2
0
from flask_boilerplate_utils.overrides import NestableBlueprint
from flask_menu.classy import register_flaskview

submodule = NestableBlueprint('frontend.examples.submodule',
                              __name__,
                              template_folder="templates",
                              static_folder="static")
submodule.expected_parameters = ['id']

from .controllers.Index import Index
Index.register(submodule)
register_flaskview(submodule, Index)


@submodule.url_value_preprocessor
def validate_id(route, args):
    """
    Here we can validate the passed arguments
    """
    pass
Exemplo n.º 3
0
from flask_boilerplate_utils.overrides import NestableBlueprint
from flask.ext import menu
from flask_menu.classy import register_flaskview

frontend = NestableBlueprint('frontend',
                             __name__,
                             template_folder="templates",
                             static_folder="static")

from .controllers.Index import Index

Index.register(frontend)
register_flaskview(frontend, Index)

# Pragma - Submodule Registration Start
# Anything after the above line will be removed after cleanup.
from .modules.learn_flask import learn_flask
from .modules.examples import examples
from .modules.cleanup import cleanup

frontend.register_blueprint(learn_flask, url_prefix='/learn-flask')
frontend.register_blueprint(examples, url_prefix='/examples')
frontend.register_blueprint(cleanup, url_prefix='/cleanup')
Exemplo n.º 4
0
from flask_boilerplate_utils.overrides import NestableBlueprint
from flask.ext import menu

submodule = NestableBlueprint('frontend.examples.submodule', __name__, template_folder="templates", 
    static_folder="static")
submodule.expected_parameters = ['id']

from .controllers.Index import Index
Index.register(submodule)
menu.register_flaskview(submodule, Index)


@submodule.url_value_preprocessor
def validate_id(route, args):
    """
    Here we can validate the passed arguments
    """
    pass

Exemplo n.º 5
0
from flask_boilerplate_utils.overrides import NestableBlueprint

learn_flask = NestableBlueprint('frontend.learn_flask',
                                __name__,
                                template_folder="templates",
                                static_folder="static")

from .controllers.MainController import MainController

MainController.register(learn_flask)

from flask_menu.classy import register_flaskview

register_flaskview(learn_flask, MainController)

import os

examples_dir = os.path.realpath(
    os.path.join(os.path.realpath(__file__), '../python_examples/'))


@learn_flask.app_template_global('load_example_with_name')
def load_example_with_name(filename):
    fpath = os.path.join(examples_dir, filename)
    with open(fpath) as fh:
        return fh.read()
Exemplo n.º 6
0
from flask_boilerplate_utils.overrides import NestableBlueprint
from flask.ext import menu

frontend = NestableBlueprint('frontend', __name__, template_folder="templates", 
    static_folder="static")

from .controllers.Index import Index
Index.register(frontend)
menu.register_flaskview(frontend, Index)

# Pragma - Submodule Registration Start
# Anything after the above line will be removed after cleanup.
from .modules.learn_flask import learn_flask
from .modules.examples import examples
from .modules.cleanup import cleanup
frontend.register_blueprint(learn_flask, url_prefix='/learn-flask')
frontend.register_blueprint(examples, url_prefix='/examples')
frontend.register_blueprint(cleanup, url_prefix='/cleanup')
Exemplo n.º 7
0
from flask_boilerplate_utils.overrides import NestableBlueprint

examples = NestableBlueprint('frontend.examples', __name__, template_folder="templates", 
    static_folder="static")

from .controllers.MainController import MainController
from .controllers.UploadsController import UploadsController
from .controllers.SecurityController import SecurityController
from .controllers.WTFormsController import WTFormsController
from .controllers.DocsController import DocsController
from .controllers.Features import Features
Features.register(examples)
MainController.register(examples)
UploadsController.register(examples)
SecurityController.register(examples)
WTFormsController.register(examples)
DocsController.register(examples)

from flask.ext import menu
menu.register_flaskview(examples, MainController)
menu.register_flaskview(examples, UploadsController)
menu.register_flaskview(examples, SecurityController)
menu.register_flaskview(examples, WTFormsController)
menu.register_flaskview(examples, Features)
menu.register_flaskview(examples, DocsController)

from .modules.submodule import submodule
examples.register_blueprint(submodule, url_prefix='/submodule/<int:id>')

import os
examples_dir = os.path.realpath(os.path.join(os.path.realpath(__file__), '../../../../../../'))
Exemplo n.º 8
0
from flask_boilerplate_utils.overrides import NestableBlueprint
from flask.ext import menu
from flask_menu.classy import register_flaskview

frontend = NestableBlueprint("frontend", __name__, template_folder="templates", static_folder="static")

from .controllers.Index import Index

Index.register(frontend)
register_flaskview(frontend, Index)

# Pragma - Submodule Registration Start
# Anything after the above line will be removed after cleanup.
from .modules.learn_flask import learn_flask
from .modules.examples import examples
from .modules.cleanup import cleanup

frontend.register_blueprint(learn_flask, url_prefix="/learn-flask")
frontend.register_blueprint(examples, url_prefix="/examples")
frontend.register_blueprint(cleanup, url_prefix="/cleanup")
Exemplo n.º 9
0
from flask_boilerplate_utils.overrides import NestableBlueprint
from flask.ext import menu
from flask_menu.classy import register_flaskview

frontend = NestableBlueprint('frontend',
                             __name__,
                             template_folder="templates",
                             static_folder="static")

from .controllers.Index import Index

Index.register(frontend)
register_flaskview(frontend, Index)