The horizon.views ModuleΒΆ
- class horizon.views.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.
- get(request, *args, **kwargs)[source]
- 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.
- horizon.views.user_home(request)[source]
Reversible named view to direct a user to the appropriate homepage.