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

All Samples(157)  |  Call(157)  |  Derive(0)  |  Import(0)
Like :meth:`Flask.add_url_rule` but for a blueprint.  The endpoint for
the :func:`url_for` function is prefixed with the name of the blueprint.

src/f/l/Flask-Restless-0.13.1/flask_restless/manager.py   Flask-Restless(Download)
        blueprint = Blueprint(blueprintname, __name__, url_prefix=url_prefix)
        # For example, /api/person.
        blueprint.add_url_rule(collection_endpoint,
                               methods=no_instance_methods, view_func=api_view)
        # For example, /api/person/1.
        blueprint.add_url_rule(collection_endpoint,
        instance_endpoint = '{0}/<instid>'.format(collection_endpoint)
        # For example, /api/person/1.
        blueprint.add_url_rule(instance_endpoint, methods=instance_methods,
                               defaults={'relationname': None,
                                         'relationinstid': None},
            '{0}/<relationinstid>'.format(relation_endpoint)
        # For example, /api/person/1/computers.
        blueprint.add_url_rule(relation_endpoint,
                               methods=possibly_empty_instance_methods,
                               defaults={'relationinstid': None},
                               view_func=api_view)
        # For example, /api/person/1/computers/2.
        blueprint.add_url_rule(relation_instance_endpoint,

src/f/l/flask-restless-HEAD/flask_restless/manager.py   flask-restless(Download)
        blueprint = Blueprint(blueprintname, __name__, url_prefix=url_prefix)
        # For example, /api/person.
        blueprint.add_url_rule(collection_endpoint,
                               methods=no_instance_methods, view_func=api_view)
        # For example, /api/person/1.
        blueprint.add_url_rule(collection_endpoint,
        instance_endpoint = '{0}/<instid>'.format(collection_endpoint)
        # For example, /api/person/1.
        blueprint.add_url_rule(instance_endpoint, methods=instance_methods,
                               defaults={'relationname': None,
                                         'relationinstid': None},
            '{0}/<relationinstid>'.format(relation_endpoint)
        # For example, /api/person/1/computers.
        blueprint.add_url_rule(relation_endpoint,
                               methods=possibly_empty_instance_methods,
                               defaults={'relationinstid': None},
                               view_func=api_view)
        # For example, /api/person/1/computers/2.
        blueprint.add_url_rule(relation_instance_endpoint,

src/h/o/home-0.1.4/home/dash/api.py   home(Download)
def register_api(view, endpoint, url):
    view_func = view.as_view(endpoint)
 
    api.add_url_rule(url, defaults={'resource_id': None, 'name': None},
                     view_func=view_func, methods=['GET', ])
 
    api.add_url_rule(url, view_func=view_func, methods=['POST', ])
 
    api.add_url_rule('%s<int:resource_id>' % (url), defaults={'name': None},
                     methods=['GET', 'PUT', 'DELETE'])
 
    api.add_url_rule('%s<string:name>' % (url), defaults={'resource_id': None},
                     view_func=view_func,
                     methods=['GET', 'PUT', 'DELETE'])

src/o/w/ownpaste-0.2.2/ownpaste/views.py   ownpaste(Download)
 
paste_view = PasteAPI.as_view('paste_api')
views.add_url_rule('/paste/', defaults={'paste_id': None, 'action': None},
                   view_func=paste_view, methods=['GET'])
views.add_url_rule('/paste/', view_func=paste_view, methods=['POST'])
views.add_url_rule('/paste/<paste_id>/', view_func=paste_view,
                   methods=['GET', 'DELETE', 'PATCH'])
views.add_url_rule('/paste/<paste_id>/<action>/', view_func=paste_view,

src/p/y/pybossa-HEAD/pybossa/api/__init__.py   pybossa(Download)
    view_func = view.as_view(endpoint)
    csrf.exempt(view_func)
    blueprint.add_url_rule(url,
                           view_func=view_func,
                           defaults={pk: None},
                           methods=['GET', 'OPTIONS'])
    blueprint.add_url_rule(url,
                           view_func=view_func,
                           methods=['POST', 'OPTIONS'])
    blueprint.add_url_rule('%s/<%s:%s>' % (url, pk_type, pk),

src/l/a/lark-0.0.4/lark/ext/flask/redis_api.py   lark(Download)
 
    for route in routes:
        redis_api_blueprint.add_url_rule(route, methods=methods, view_func=view_func, endpoint=redispy_method)
        redis_api_blueprint.add_url_rule(route.lower(), methods=methods, view_func=view_func, endpoint=redispy_method)
 

src/f/l/flask-admin-old-HEAD/flask_admin/__init__.py   flask-admin-old(Download)
        return delete
 
    admin_blueprint.add_url_rule('/', 'index',
                                 view_func=create_index_view())
    list_view = create_list_view()
    admin_blueprint.add_url_rule('/list/<model_name>/',
                                 'list', view_func=list_view)
    admin_blueprint.add_url_rule('/list/<model_name>/',
                                 'list_view', view_func=list_view)
    admin_blueprint.add_url_rule('/edit/<model_name>/<path:model_url_key>/',
                                 'edit', view_func=create_edit_view(),
                                 methods=['GET', 'POST'])
    admin_blueprint.add_url_rule('/delete/<model_name>/<path:model_url_key>/',
                                 'delete', view_func=create_delete_view())
    admin_blueprint.add_url_rule('/add/<model_name>/',

src/i/a/iati-datastore-HEAD/iati_datastore/iatilib/frontend/api1.py   iati-datastore(Download)
 
api.add_url_rule(
    '/access/activity',
    defaults={"format": ".json"},
    view_func=ActivityView.as_view('activity')
)
 
api.add_url_rule(
    '/access/activity<format>',
 
api.add_url_rule(
    '/access/activity/by_country<format>',
    view_func=ActivityByCountryView.as_view('activity_by_country'))
 
api.add_url_rule(
    '/access/activity/by_sector<format>',
 
api.add_url_rule(
    '/access/transaction<format>',
    view_func=TransactionsView.as_view('transaction_list'))
 

src/f/l/Flask-DBConfig-0.3.12/flaskext/dbconfig.py   Flask-DBConfig(Download)
                                          url_prefix=self.url_ext)
 
        self.config_blueprint.add_url_rule("/", "display_configuration_page", view_func=self.display_configuration_page, methods=["GET"])
        self.config_blueprint.add_url_rule("/api", "configure_variables_from_post", view_func=self.configure_variables_from_post, methods=["POST"])
        app.register_blueprint(self.config_blueprint)

src/f/l/flask-tumblelog-HEAD/tumblelog/admin.py   flask-tumblelog(Download)
 
# Register the urls
admin.add_url_rule('/admin/', view_func=List.as_view('index'))
admin.add_url_rule('/admin/create/', defaults={'slug': None}, view_func=Detail.as_view('create'))
admin.add_url_rule('/admin/<slug>/', view_func=Detail.as_view('edit'))

  1 | 2 | 3 | 4 | 5 | 6  Next