The horizon.views.base ModuleΒΆ

class horizon.views.base.APIView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

A quick class-based view for putting API data into a template.

Subclasses must define one method, get_data, and a template name via the template_name attribute on the class.

Errors within the get_data function are automatically caught by the horizon.exceptions.handle() error handler if not otherwise caught.

APIView.get(request, *args, **kwargs)[source]
APIView.get_data(request, context, *args, **kwargs)[source]

This method should handle any necessary API calls, update the context object, and return the context object at the end.

Previous topic

The horizon.views Module

Next topic

The horizon.views.auth Module

This Page