Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(17)  |  Call(12)  |  Derive(0)  |  Import(5)
Main instance for adding *lazy* views to Flask application or blueprint.

src/l/e/learnpython.in.ua-HEAD/learnpython/app.py   learnpython.in.ua(Download)
from flask.ext.babel import Babel
from flask.ext.flatpages import FlatPages
from flask.ext.lazyviews import LazyViews
from flask.ext.mail import Mail
from flask.ext.script import Manager
 
# Register all possible urls
views = LazyViews(app, '.views')
views.add('/', 'page', defaults={'name': 'index'}, endpoint='index')
views.add('/contacts', 'contacts', methods=('GET', 'POST'))

src/f/l/Flask-LazyViews-HEAD/testapp/tests.py   Flask-LazyViews(Download)
 
from flask import Blueprint, Flask, url_for
from flask.ext.lazyviews import LazyViews
from werkzeug.utils import ImportStringError
 
    def test_custom_config_app(self):
        views = LazyViews(self.app, import_prefix='testapp.views')
        views.add('/default-page',
                  'page',
                  defaults={'page_id': 1},
    def test_custom_config_blueprint(self):
        name = self.get_blueprint_name()
        blueprint = init_blueprint(name)
 
        views = LazyViews(blueprint, import_prefix=blueprint.import_name)
    def test_error_config_app(self):
        views = LazyViews(self.app, import_prefix='weird.path')
        views.add('/default-page',
                  'views.page',
                  defaults={'page_id': 1},
                          self.url('default_page'))
 
        views = LazyViews(self.app, import_prefix='testapp.views')
        views.add('/another-default-page',
                  'does_not_exist',

src/f/l/Flask-LazyViews-HEAD/testapp/test/blueprint.py   Flask-LazyViews(Download)
from flask import Blueprint
from flask.ext.lazyviews import LazyViews
 
from .admin import AdminView
 
                          template_folder='templates')
 
    views = LazyViews(blueprint, import_prefix='.views')
    views.add('/', 'test')
    views.add('/advanced', 'advanced', methods=('GET', 'POST'))

src/f/l/Flask-Dropbox-HEAD/testapp/app.py   Flask-Dropbox(Download)
from flask import Flask
from flask.ext.dropbox import Dropbox
from flask.ext.lazyviews import LazyViews
from flask.ext.script import Manager
 
 
# Add test project views
views = LazyViews(app, 'testapp.views')
views.add('/', 'home')
views.add('/delete/<path:filename>', 'delete')

src/f/l/Flask-LazyViews-HEAD/testapp/app.py   Flask-LazyViews(Download)
from flask import Flask
from flask.ext.admin import Admin
from flask.ext.lazyviews import LazyViews
from flask.ext.sqlalchemy import SQLAlchemy
 
 
    # Add url rules to application
    views = LazyViews(app)
    views.add('/', 'views.home')
    views.add('/db', 'views.database_page')