Skip to content

Updating query parameters in a link #217

Answered by elimintz
adam820 asked this question in Q&A
Discussion options

You must be logged in to vote

@adam820 Is this what you are looking to do:

import justpy as jp

def link_test(request):
    wp = jp.WebPage()
    foo = request.query_params.get('foo', 'No foo' )
    foo2 = request.query_params.get('foo2', 'No foo2' )
    jp.Div(text=f'foo: {foo}, foo2: {foo2}', classes="m-4 text-xl", a=wp)
    jp.A(text='New link', href='http://localhost:8000/?foo=bar&foo2=buz', a=wp,
         classes='m-4 p-2 text-xl text-white bg-blue-500 hover:bg-blue-700')
    return wp

jp.justpy(link_test)

If not, please let me know

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by adam820
Comment options

You must be logged in to vote
2 replies
@matthoendorf
Comment options

@adam820
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants