bag.web.pyramid.burla module¶
Integration of bag.web.burla
into Pyramid.
Burla provides powerful URL generation independent of web frameworks.
From this module you can import the variable ops
and then use it to
register pages and operations with burla.
burla can autogenerate documentation for those registered pages and operations.
Finally, burla can register them as Pyramid views. For this you need to add, to the bottom of your Pyramid initialization, this call:
ops.register_pyramid_views()
TODO: Use the registry instead of a global variable “ops”.
- class bag.web.pyramid.burla.PyramidBurla(root='', page_class=<class 'bag.web.burla.Page'>, op_class=<class 'bag.web.burla.Operation'>)[source]¶
Bases:
bag.web.burla.Burla
Subclass of Burla for integration with Pyramid.
- op(op_name, section='Miscellaneous', **kw)[source]¶
Decorator to register an API operation.
Decorate your view handlers with this to register an operation with Burla as well as with Pyramid.
- bag.web.pyramid.burla.add_api_doc_view(config, url='/doc_api', **kw)[source]¶
Add to a Pyramid web app a URL documenting its API.
- Return type
None
- bag.web.pyramid.burla.add_http_operations_list_url(config, url='/http_operations')[source]¶
Add a view that returns pages and HTTP operations as JSON.