Endpoint#
Base class: Traversable
Class that describes an endpoint in iommi. You can create your own custom endpoints on any Part.
Example:
def my_view(request):
return Page(
parts__h1=html.h1('Hi!'),
endpoints__echo__func=lambda value, **_: value,
)
this page will respond to ?/echo=foo
by returning a json response "foo"
.
An endpoint can return an HttpResponse directly, a Part
which is rendered for you,
and everything else we try to dump to json for you.
Refinable members#
assets
endpoints
func
Type:
Callable
include
Type:
bool
Default:
True
iommi_style
Type:
str