:py:mod:`pypnusershub.routes` ============================= .. py:module:: pypnusershub.routes Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pypnusershub.routes.ConfigurableBlueprint Functions ~~~~~~~~~ .. autoapisummary:: pypnusershub.routes.login pypnusershub.routes.public_login pypnusershub.routes.logout pypnusershub.routes.insert_or_update_organism pypnusershub.routes.insert_or_update_role Attributes ~~~~~~~~~~ .. autoapisummary:: pypnusershub.routes.log pypnusershub.routes.routes .. py:data:: log .. py:class:: ConfigurableBlueprint(name: str, import_name: str, static_folder: str | os.PathLike | None = None, static_url_path: str | None = None, template_folder: str | os.PathLike | None = None, url_prefix: str | None = None, subdomain: str | None = None, url_defaults: dict | None = None, root_path: str | None = None, cli_group: str | None = _sentinel) Bases: :py:obj:`flask.Blueprint` Represents a blueprint, a collection of routes and other app-related functions that can be registered on a real application later. A blueprint is an object that allows defining application functions without requiring an application object ahead of time. It uses the same decorators as :class:`~flask.Flask`, but defers the need for an application by recording them for later registration. Decorating a function with a blueprint creates a deferred function that is called with :class:`~flask.blueprints.BlueprintSetupState` when the blueprint is registered on an application. See :doc:`/blueprints` for more information. :param name: The name of the blueprint. Will be prepended to each endpoint name. :param import_name: The name of the blueprint package, usually ``__name__``. This helps locate the ``root_path`` for the blueprint. :param static_folder: A folder with static files that should be served by the blueprint's static route. The path is relative to the blueprint's root path. Blueprint static files are disabled by default. :param static_url_path: The url to serve static files from. Defaults to ``static_folder``. If the blueprint does not have a ``url_prefix``, the app's static route will take precedence, and the blueprint's static files won't be accessible. :param template_folder: A folder with templates that should be added to the app's template search path. The path is relative to the blueprint's root path. Blueprint templates are disabled by default. Blueprint templates have a lower precedence than those in the app's templates folder. :param url_prefix: A path to prepend to all of the blueprint's URLs, to make them distinct from the rest of the app's routes. :param subdomain: A subdomain that blueprint routes will match on by default. :param url_defaults: A dict of default values that blueprint routes will receive by default. :param root_path: By default, the blueprint will automatically set this based on ``import_name``. In certain situations this automatic detection can fail, so the path can be specified manually instead. .. versionchanged:: 1.1.0 Blueprints have a ``cli`` group to register nested CLI commands. The ``cli_group`` parameter controls the name of the group under the ``flask`` command. .. versionadded:: 0.7 .. py:method:: register(app, *args, **kwargs) Called by :meth:`Flask.register_blueprint` to register all views and callbacks registered on the blueprint with the application. Creates a :class:`.BlueprintSetupState` and calls each :meth:`record` callback with it. :param app: The application this blueprint is being registered with. :param options: Keyword arguments forwarded from :meth:`~Flask.register_blueprint`. .. versionchanged:: 2.3 Nested blueprints now correctly apply subdomains. .. versionchanged:: 2.1 Registering the same blueprint with the same name multiple times is an error. .. versionchanged:: 2.0.1 Nested blueprints are registered with their dotted name. This allows different blueprints with the same name to be nested at different locations. .. versionchanged:: 2.0.1 The ``name`` option can be used to change the (pre-dotted) name the blueprint is registered with. This allows the same blueprint to be registered multiple times with unique names for ``url_for``. .. py:data:: routes .. py:function:: login() .. py:function:: public_login() .. py:function:: logout() .. py:function:: insert_or_update_organism(organism) Insert a organism .. py:function:: insert_or_update_role(data) Insert or update a role (also add groups if provided)