msaJustPyUI Module¶
.jpcore.justpy_app
¶
Created on 2022-09-02 modified version, original from JustPy @author: wf (modification swelcker)
Attributes¶
FRONTEND_ENGINE_LIBS
module-attribute
¶
TEMPLATES_DIRECTORY
module-attribute
¶
template_options
module-attribute
¶
template_options = {
"tailwind": TAILWIND,
"quasar": QUASAR,
"quasar_version": QUASAR_VERSION,
"highcharts": HIGHCHARTS,
"aggrid": AGGRID,
"aggrid_enterprise": AGGRID_ENTERPRISE,
"static_name": STATIC_NAME,
"component_file_list": component_file_list,
"no_internet": NO_INTERNET,
"katex": KATEX,
"plotly": PLOTLY,
"bokeh": BOKEH,
"deckgl": DECKGL,
"vega": VEGA,
}
Classes¶
JustpyAjaxEndpoint ¶
Bases: HTTPEndpoint
Justpy specific HTTPEndpoint/app (ASGI application)
JustpyApp ¶
Bases: Starlette
a justpy application is a special FastAPI/Starlette Addition/MixIn
Attributes¶
Functions¶
add_jproute ¶
add a route for the given Webpage returning func
PARAMETER | DESCRIPTION |
---|---|
path |
the path to use as route
TYPE:
|
wpfunc |
a Webpage returning func
TYPE:
|
name |
the name of the route
TYPE:
|
get_page_for_func
async
¶
get the Webpage for the given func
PARAMETER | DESCRIPTION |
---|---|
request |
the request to pass to the given function
|
func |
the function
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
WebPage
|
the Webpage returned by the given function
TYPE:
|
get_response_for_load_page ¶
get the response for the given webpage
PARAMETER | DESCRIPTION |
---|---|
request |
the request to handle
TYPE:
|
load_page(WebPage) |
the webpage to wrap with justpy and
|
RETURNS | DESCRIPTION |
---|---|
response
|
the response for the given load_page
TYPE:
|
handle_session_cookie ¶
handle the session cookie for this request
RETURNS | DESCRIPTION |
---|---|
typing.Union[bool, Response]
|
True if a new cookie and session has been created |
jproute ¶
justpy route decorator
function will we "wrapped" as a response and a route added
PARAMETER | DESCRIPTION |
---|---|
func(typing.Callable) |
the function to convert to a reponse
|
response ¶
response decorator converts a function to a response
see also https://github.com/justpy-org/justpy/issues/532 castAsEndPoint
PARAMETER | DESCRIPTION |
---|---|
func |
the function (returning a WebPage) to convert to a response
TYPE:
|
set_cookie ¶
set_cookie(
request: Request,
response: Response,
load_page: WebPage,
new_cookie: typing.Union[bool, Response],
) -> Response
set the cookie_value
PARAMETER | DESCRIPTION |
---|---|
request |
the request
TYPE:
|
response |
the response to be sent
TYPE:
|
load_page |
the WebPage to handle
TYPE:
|
new_cookie |
True if there is a new cookie. Or Response if cookie was invalid
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
response
|
the response object
TYPE:
|
Functions¶
Created: September 28, 2022