joop.flask.example — joop 0.0.1 documentation

# joop.flask.example

This is the default place to turn example or other View definitions into

  flask-specific views.

Classes

`FlaskHello`() |
`FlaskName`() |
`FlaskTablePage`() |

class joop.flask.example.FlaskHello

  Bases: `HelloView`, `FlaskView`

  class Endpoint

    Bases: `Endpoint`

  classmethod add_to_app(app: object)

    Add the view to a web application with the specified configuration.

    This method validates the view’s configuration and registers it with the web application using the _add_to_app method.

    Parameters:

      app (object) – The web application instance.

    Raises:

      NotImplementedError – If the view’s configuration is incomplete or invalid.

  classmethod get_jinja_env()

    Retrieve the Jinja2 environment by calling the abstract method.

    Returns:

      The Jinja2 environment associated with the view.

    Return type:

      jinja2.Environment

  classmethod render(**kwargs)

    Render the component and return the rendered output as a string.

    Parameters:

      **kwargs – Keyword arguments to be passed to the component’s inputs and subcomponents.

    Returns:

      The rendered output of the component.

    Return type:

      str

class joop.flask.example.FlaskName

  Bases: `NameView`, `FlaskView`

  class Endpoint

    Bases: `Endpoint`

  classmethod add_to_app(app: object)

    Add the view to a web application with the specified configuration.

    This method validates the view’s configuration and registers it with the web application using the _add_to_app method.

    Parameters:

      app (object) – The web application instance.

    Raises:

      NotImplementedError – If the view’s configuration is incomplete or invalid.

  classmethod get_jinja_env()

    Retrieve the Jinja2 environment by calling the abstract method.

    Returns:

      The Jinja2 environment associated with the view.

    Return type:

      jinja2.Environment

  classmethod render(**kwargs)

    Render the component and return the rendered output as a string.

    Parameters:

      **kwargs – Keyword arguments to be passed to the component’s inputs and subcomponents.

    Returns:

      The rendered output of the component.

    Return type:

      str

class joop.flask.example.FlaskTablePage

  Bases: `MyTableWholePage`, `FlaskView`

  class Endpoint

    Bases: `Endpoint`

    Defines the endpoint for the MyTableWholePage view.

    _url

      The URL path for the endpoint.

      Type:

        str

    _name

      The name of the endpoint.

      Type:

        str

    _methods

      The HTTP methods supported by the endpoint.

      Type:

        list

  classmethod add_to_app(app: object)

    Add the view to a web application with the specified configuration.

    This method validates the view’s configuration and registers it with the web application using the _add_to_app method.

    Parameters:

      app (object) – The web application instance.

    Raises:

      NotImplementedError – If the view’s configuration is incomplete or invalid.

  classmethod get_jinja_env()

    Retrieve the Jinja2 environment by calling the abstract method.

    Returns:

      The Jinja2 environment associated with the view.

    Return type:

      jinja2.Environment

  classmethod render(**kwargs)

    Render the component and return the rendered output as a string.

    Parameters:

      **kwargs – Keyword arguments to be passed to the component’s inputs and subcomponents.

    Returns:

      The rendered output of the component.

    Return type:

      str