Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_query only if values if valid Python True value #20

Open
luzfcb opened this issue Feb 26, 2016 · 0 comments
Open

add_query only if values if valid Python True value #20

luzfcb opened this issue Feb 26, 2016 · 0 comments

Comments

@luzfcb
Copy link

luzfcb commented Feb 26, 2016

Hello, first, thank you, your library is very useful.

it is possible to make a conditional inclusion

assuming I have these three variables in the template context

{
    'next_kwarg_name' : 'goto',
    'next_page_url' : 'http://google.com',
    'popup': False,
}

and this url

{% url 'my_updateview' pk=object.pk as base_my_updateview_url %} 


{% spurl base=base_my_updateview_url add_query="{{ next_kwarg_name }}={{ next_page_url }}" add_query="popup={{ popup }}" as documento_update_url %}

suposing that base_my_updateview_url value is http://127.0.0.1:8000/update/1

documento_update_url value that I would like to get is:
http://127.0.0.1:8000/update/1?goto=http://google.com

I currently I get:

http://127.0.0.1:8000/update/1?goto=http://google.com&popup=False

If it is not possible, would you have any suggestions on how to resolve this case.
Thanks.

@bashu bashu self-assigned this May 9, 2018
@bashu bashu unassigned bashu Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants