Class haproxy.embed.View
Simple class-based views.
Methods
haproxy.embed.View:as_view (request, context) | Initialize and immediately dispatch the view. |
haproxy.embed.View:dispatch (request, context) | Dispatch a request to the method handler. |
haproxy.embed.View:methods () | Return list of methods handled by the view. |
haproxy.embed.View:new (name) | Create a new named View (i.e., subclass of View). |
haproxy.embed.View:options (request) | Default handler for OPTIONS requests. |
Methods
- haproxy.embed.View:as_view (request, context)
-
Initialize and immediately dispatch the view.
Useful for assigning a class-based view to a route.
NOTE: This is a class method, not an instance method. It does not take an implicit self argument.
Parameters:
- request haproxy.embed.Request
- context table request context (i.e., shared state)
Returns:
See also:
Usage:
response = MyView.as_view(request, context)
- haproxy.embed.View:dispatch (request, context)
-
Dispatch a request to the method handler.
Parameters:
- request haproxy.embed.Request
- context table request context (i.e., shared state)
Returns:
See also:
- haproxy.embed.View:methods ()
-
Return list of methods handled by the view.
Returns:
-
table
list of available methods
- haproxy.embed.View:new (name)
-
Create a new named View (i.e., subclass of View).
Parameters:
- name string
Returns:
- haproxy.embed.View:options (request)
-
Default handler for OPTIONS requests.
Returns HTTP 204 No Content and a list of allowed methods.
Parameters:
- request haproxy.embed.Request
Returns: