turbo_helper.shortcuts¶

Functions¶

redirect_303(to, *args, **kwargs)

Sends an HTTP 303 redirect.

get_respond_to(request)

respond_to(request)

Inspired by Rails

Module Contents¶

turbo_helper.shortcuts.redirect_303(to, *args, **kwargs)¶

Sends an HTTP 303 redirect.

All arguments are forwarded to django.shortcuts.resolve_url to generate the redirect URL.

https://github.com/django/django/blob/9c436a09b3a641874881706495ae07293aa97c2f/django/shortcuts.py#L151

Parameters:

to (Union[str, django.db.models.Model])

Return type:

turbo_helper.response.HttpResponseSeeOther

turbo_helper.shortcuts.get_respond_to(request)¶
turbo_helper.shortcuts.respond_to(request)¶

Inspired by Rails

https://www.writesoftwarewell.com/how-respond_to-method-works-rails/

respond_to do |format|

format.turbo_stream { render turbo_stream: turbo_stream_template }

end