writer / writer-framework

No-code in the front, Python in the back. An open-source framework for creating data apps.
https://dev.writer.com/framework/introduction
Apache License 2.0
1.32k stars 76 forks source link

pick up the URL variables at the start of the app #413

Open thondeboer opened 6 months ago

thondeboer commented 6 months ago

I have an app that I want to be able to use URL variables, and I can figure out how to setup a handler when the values CHANGE, but how do I get the INITIAL settings of the URL values? There is no equivalent state.get_route_vars() it seems so how do I get those values at startup?

FabienArcellier commented 5 months ago

Hi,

Did you try to use the session object with the http header referer ? You have access to the url at the origin of the call. You should be able to parse it with urlparse lib.

def handle_app_enter(state, session):
    print(session['headers'].get('referer'))

An event is missing to capture a user's entry into the application at the root level. You must necessarily use the one on the page wf-page-open.

We can imagine a wf-app-open event.

thondeboer commented 5 months ago

Thanks. I got quite confused with the rebranding. Did I miss the announcement?Regards,ThonOn Jun 5, 2024, at 23:05, Fabien Arcellier @.***> wrote: Hi, Did you try to use the session object with the http header referer ? You have access to the url at the origin of the call. You should be able to parse it with urlparse lib. def handle_app_enter(state, session): print(session['headers'].get('referer'))

An event is missing to capture a user's entry into the application at the root level. You must necessarily use the one on the page wf-page-open. We can imagine a wf-app-open event.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

atzimot commented 4 months ago

any news on this issue ?

FabienArcellier commented 3 months ago

We haven't planned the work on that yet.

ramedina86 commented 2 months ago

We've revisited this and we've decided to move forward with a new event in Root that'll be able to get URL information.