joop.flask.example¶
- This is the default place to turn example or other View definitions into
flask-specific views.
Classes
- class joop.flask.example.FlaskHello[source]¶
Bases:
HelloView,FlaskView- 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[source]¶
Bases:
NameView,FlaskView- 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[source]¶
Bases:
MyTableWholePage,FlaskView- class Endpoint¶
Bases:
EndpointDefines 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