turbo_helper¶
Submodules¶
Attributes¶
Classes¶
Functions¶
|
Sends an HTTP 303 redirect. |
|
Inspired by Rails |
|
|
|
|
|
|
Package Contents¶
- turbo_helper.get_current_request()¶
- class turbo_helper.TurboStreamResponse(*args, **kwargs)¶
Bases:
django.http.HttpResponse
- turbo_helper.redirect_303(to, *args, **kwargs)¶
Sends an HTTP 303 redirect.
All arguments are forwarded to django.shortcuts.resolve_url to generate the redirect URL.
- Parameters:
to (Union[str, django.db.models.Model])
- Return type:
- turbo_helper.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
- turbo_helper.after_create_commit(sender)¶
- turbo_helper.after_delete_commit(sender)¶
- turbo_helper.after_update_commit(sender)¶
- turbo_helper.register_turbo_stream_action(name)¶
- turbo_helper.turbo_stream¶