Web Interface Blueprint Modules¶
hedwig.web.blueprint.admin¶
- hedwig.web.blueprint.admin.create_admin_blueprint(db, facilities)¶
Create Flask Blueprint for the site-wide administrative interface.
hedwig.web.blueprint.facility¶
- hedwig.web.blueprint.facility.create_facility_blueprint(db, facility)¶
Create Flask blueprint for a facility.
Calculators
A list of possible HTML templates to use for the calculator is constructed as follows:
<facility_code>/calculator_<calculator_code>.html
The template for this particular calculator in the current facility’s template directory.
<calculator_facility_code>/calculator_<calculator_code>.html
The template for this particular calculator in the template directory for the facility (code) returned by the calculator’s
get_default_facility_code()method, if that method returns a value other than None.generic/calculator_base.html
The base calculator template.
Target Tools
A list of possible HTML templates to use for the target tool is constructed as follows:
<facility code>/tool_<tool code>.html
The template for the specific tool and current facility.
<tool facility code>/tool_<tool code>.html
The template for the specific tool and its default facility.
generic/tool_base.html
The base target tool template.
- hedwig.web.blueprint.facility.make_custom_redirect(target, target_opts={})¶
Create a view function for a redirect to the given target.
The target and options (for use with url_for) must be passed rather than a direct URL so that url_for can be called in the context of handing a request.
- hedwig.web.blueprint.facility.make_custom_route(db, template, func, include_args=False, allow_post=False, post_files=[], send_file_opts={}, extra_params=[], auth_required=False, admin_required=False, init_route_params=[], extra_context=None)¶
Create a custom view function.
Creates a route handler which calls the specified function func with the arguments:
Database control object.
Any route arguments listed in init_route_params.
Any specified extra_params.
If include_args was specified: the request arguments.
If allow_post was specified: the request form (if the request is a POST, or None otherwise).
If allow_post was specified: for each entry in post_files, the corresponding file (if the request is a POST, or None otherwise).
Any other route keyword arguments (not listed in init_route_params).
If the template argument is specified then the view function is wrapped by the
templated()decorator. Otherwise it is assumed that a file is being generated and thesend_file()decorator is applied instead, with the given send_file_opts.If extra_context is specified, the context dictionary returned by the view function is updated using it (like a context processor).
hedwig.web.blueprint.help¶
- hedwig.web.blueprint.help.create_help_blueprint(db)¶
Create Flask Blueprint for the online help system.
hedwig.web.blueprint.home¶
- hedwig.web.blueprint.home.create_home_blueprint(db, facilities)¶
Create Flask Blueprint for the home and other related pages.
hedwig.web.blueprint.oauth¶
- hedwig.web.blueprint.oauth.create_oauth_blueprint(db, app)¶
Create Flask Blueprint for an OAuth 2 service.
- hedwig.web.blueprint.oauth.query_client(client_id)¶
- hedwig.web.blueprint.oauth._configure_clients()¶
- hedwig.web.blueprint.oauth._configure_key()¶
- hedwig.web.blueprint.oauth.save_token(token_data, request)¶
- class hedwig.web.blueprint.oauth.OpenIDCode(*args: Any, **kwargs: Any)¶
- exists_nonce(nonce, request)¶
- get_jwt_config(grant)¶
- generate_user_info(user, scope)¶
- class hedwig.web.blueprint.oauth.AuthorizationCodeGrant(*args: Any, **kwargs: Any)¶
- save_authorization_code(code, request)¶
- query_authorization_code(code, client)¶
- delete_authorization_code(authorization_code)¶
- authenticate_user(authorization_code)¶
- class hedwig.web.blueprint.oauth.Client(id, name, secret, redirect_uris)¶
- get_client_id()¶
- get_default_redirect_uri()¶
- get_allowed_scope(scope)¶
- check_redirect_uri(redirect_uri)¶
- has_client_secret()¶
- check_client_secret(client_secret)¶
- check_token_endpoint_auth_method(method)¶
- check_response_type(response_type)¶
- check_grant_type(grant_type)¶
hedwig.web.blueprint.people¶
- hedwig.web.blueprint.people.create_people_blueprint(db, facilities)¶
Create Flask Blueprint for pages related to users, personal profiles and institutions.
hedwig.web.blueprint.query¶
- hedwig.web.blueprint.query.create_query_blueprint(db)¶
Create Flask Blueprint for services to be queried by our JavaScript code.